diff options
author | Shawn O. Pearce <sop@google.com> | 2011-11-29 12:32:56 -0800 |
---|---|---|
committer | Shawn O. Pearce <sop@google.com> | 2011-11-29 14:43:04 -0800 |
commit | cc14fa9820a4c9fb7a403bbe1264856c6437bf96 (patch) | |
tree | dfbd9b5de0c190815ea07f1b3f8e46b7acf14d7a /git_refs.py | |
parent | 3ce2a6b46bb368f000d25782e24d701f68f32659 (diff) | |
download | git-repo-cc14fa9820a4c9fb7a403bbe1264856c6437bf96.tar.gz |
Improve error handling when reading loose refsv1.7.8
When repo is trying to figure out branches the repository has by
traversing refs/heads, add exception handling for readline.
Change-Id: If3b2a3720c6496f52f629aa9a2539f186d6ec882
Diffstat (limited to 'git_refs.py')
-rw-r--r-- | git_refs.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/git_refs.py b/git_refs.py index ac8ed0c1..0e3cc820 100644 --- a/git_refs.py +++ b/git_refs.py | |||
@@ -139,13 +139,15 @@ class GitRefs(object): | |||
139 | def _ReadLoose1(self, path, name): | 139 | def _ReadLoose1(self, path, name): |
140 | try: | 140 | try: |
141 | fd = open(path, 'rb') | 141 | fd = open(path, 'rb') |
142 | mtime = os.path.getmtime(path) | 142 | except: |
143 | except OSError: | ||
144 | return | ||
145 | except IOError: | ||
146 | return | 143 | return |
144 | |||
147 | try: | 145 | try: |
148 | id = fd.readline() | 146 | try: |
147 | mtime = os.path.getmtime(path) | ||
148 | id = fd.readline() | ||
149 | except: | ||
150 | return | ||
149 | finally: | 151 | finally: |
150 | fd.close() | 152 | fd.close() |
151 | 153 | ||