summaryrefslogtreecommitdiffstats
path: root/git_refs.py
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@sonymobile.com>2012-09-24 12:15:13 +0900
committerGustaf Lundh <gustaf.lundh@sonymobile.com>2012-10-09 12:45:30 +0200
commit8a68ff96057ec58e524a3e41a2d8dca7b5d016bc (patch)
tree22f6971e8d3c4a90d11d3704602d073a852328b4 /git_refs.py
parente3b1c45aebed329cbc9ad172b1d8e812cf208117 (diff)
downloadgit-repo-8a68ff96057ec58e524a3e41a2d8dca7b5d016bc.tar.gz
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
Diffstat (limited to 'git_refs.py')
-rw-r--r--git_refs.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/git_refs.py b/git_refs.py
index 11241438..18c9230c 100644
--- a/git_refs.py
+++ b/git_refs.py
@@ -115,10 +115,10 @@ class GitRefs(object):
115 115
116 line = line[:-1] 116 line = line[:-1]
117 p = line.split(' ') 117 p = line.split(' ')
118 id = p[0] 118 ref_id = p[0]
119 name = p[1] 119 name = p[1]
120 120
121 self._phyref[name] = id 121 self._phyref[name] = ref_id
122 finally: 122 finally:
123 fd.close() 123 fd.close()
124 self._mtime['packed-refs'] = mtime 124 self._mtime['packed-refs'] = mtime
@@ -144,18 +144,18 @@ class GitRefs(object):
144 try: 144 try:
145 try: 145 try:
146 mtime = os.path.getmtime(path) 146 mtime = os.path.getmtime(path)
147 id = fd.readline() 147 ref_id = fd.readline()
148 except: 148 except:
149 return 149 return
150 finally: 150 finally:
151 fd.close() 151 fd.close()
152 152
153 if not id: 153 if not ref_id:
154 return 154 return
155 id = id[:-1] 155 ref_id = ref_id[:-1]
156 156
157 if id.startswith('ref: '): 157 if ref_id.startswith('ref: '):
158 self._symref[name] = id[5:] 158 self._symref[name] = ref_id[5:]
159 else: 159 else:
160 self._phyref[name] = id 160 self._phyref[name] = ref_id
161 self._mtime[name] = mtime 161 self._mtime[name] = mtime