mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-06-26 20:17:52 +00:00
Coding style cleanup
Fix the following issues reported by pylint: C0321: More than one statement on a single line W0622: Redefining built-in 'name' W0612: Unused variable 'name' W0613: Unused argument 'name' W0102: Dangerous default value 'value' as argument W0105: String statement has no effect Also fixed a few cases of inconsistent indentation. Change-Id: Ie0db839e7c57d576cff12d8c055fe87030d00744
This commit is contained in:
committed by
Gustaf Lundh
parent
e3b1c45aeb
commit
8a68ff9605
16
git_refs.py
16
git_refs.py
@ -115,10 +115,10 @@ class GitRefs(object):
|
||||
|
||||
line = line[:-1]
|
||||
p = line.split(' ')
|
||||
id = p[0]
|
||||
ref_id = p[0]
|
||||
name = p[1]
|
||||
|
||||
self._phyref[name] = id
|
||||
self._phyref[name] = ref_id
|
||||
finally:
|
||||
fd.close()
|
||||
self._mtime['packed-refs'] = mtime
|
||||
@ -144,18 +144,18 @@ class GitRefs(object):
|
||||
try:
|
||||
try:
|
||||
mtime = os.path.getmtime(path)
|
||||
id = fd.readline()
|
||||
ref_id = fd.readline()
|
||||
except:
|
||||
return
|
||||
finally:
|
||||
fd.close()
|
||||
|
||||
if not id:
|
||||
if not ref_id:
|
||||
return
|
||||
id = id[:-1]
|
||||
ref_id = ref_id[:-1]
|
||||
|
||||
if id.startswith('ref: '):
|
||||
self._symref[name] = id[5:]
|
||||
if ref_id.startswith('ref: '):
|
||||
self._symref[name] = ref_id[5:]
|
||||
else:
|
||||
self._phyref[name] = id
|
||||
self._phyref[name] = ref_id
|
||||
self._mtime[name] = mtime
|
||||
|
Reference in New Issue
Block a user