summaryrefslogtreecommitdiffstats
path: root/git_refs.py
diff options
context:
space:
mode:
Diffstat (limited to 'git_refs.py')
-rw-r--r--git_refs.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/git_refs.py b/git_refs.py
index 3c8a9867..2d4a8090 100644
--- a/git_refs.py
+++ b/git_refs.py
@@ -131,11 +131,14 @@ class GitRefs(object):
131 base = os.path.join(self._gitdir, prefix) 131 base = os.path.join(self._gitdir, prefix)
132 for name in platform_utils.listdir(base): 132 for name in platform_utils.listdir(base):
133 p = os.path.join(base, name) 133 p = os.path.join(base, name)
134 if platform_utils.isdir(p): 134 # We don't implement the full ref validation algorithm, just the simple
135 # rules that would show up in local filesystems.
136 # https://git-scm.com/docs/git-check-ref-format
137 if name.startswith('.') or name.endswith('.lock'):
138 pass
139 elif platform_utils.isdir(p):
135 self._mtime[prefix] = os.path.getmtime(base) 140 self._mtime[prefix] = os.path.getmtime(base)
136 self._ReadLoose(prefix + name + '/') 141 self._ReadLoose(prefix + name + '/')
137 elif name.endswith('.lock'):
138 pass
139 else: 142 else:
140 self._ReadLoose1(p, prefix + name) 143 self._ReadLoose1(p, prefix + name)
141 144
@@ -144,7 +147,7 @@ class GitRefs(object):
144 with open(path) as fd: 147 with open(path) as fd:
145 mtime = os.path.getmtime(path) 148 mtime = os.path.getmtime(path)
146 ref_id = fd.readline() 149 ref_id = fd.readline()
147 except (IOError, OSError): 150 except (OSError, UnicodeError):
148 return 151 return
149 152
150 try: 153 try: