When repo is trying to figure out branches the repository has by traversing refs/heads, add exception handling for readline. Change-Id: If3b2a3720c6496f52f629aa9a2539f186d6ec882
@@ -139,13 +139,15 @@ class GitRefs(object):
def _ReadLoose1(self, path, name):
try:
fd = open(path, 'rb')
- mtime = os.path.getmtime(path)
- except OSError:
- return
- except IOError:
+ except:
return
+
- id = fd.readline()
+ try:
+ mtime = os.path.getmtime(path)
+ id = fd.readline()
+ return
finally:
fd.close()