From 346424daaaf2bb3936b5f4c2891101763dc2bdc0 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 19 Feb 2015 18:02:35 +0100 Subject: Assure to not iterate packed-refs file, ever. Related to #252 --- git/refs/symbolic.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'git/refs/symbolic.py') diff --git a/git/refs/symbolic.py b/git/refs/symbolic.py index fed7006e..d884250f 100644 --- a/git/refs/symbolic.py +++ b/git/refs/symbolic.py @@ -140,6 +140,7 @@ class SymbolicReference(object): # Don't only split on spaces, but on whitespace, which allows to parse lines like # 60b64ef992065e2600bfef6187a97f92398a9144 branch 'master' of git-server:/path/to/repo tokens = value.split() + assert(len(tokens) != 0) except (OSError, IOError): # Probably we are just packed, find our entry in the packed refs file # NOTE: We are not a symbolic ref if we are in a packed file, as these @@ -582,6 +583,8 @@ class SymbolicReference(object): # END prune non-refs folders for f in files: + if f == 'packed-refs': + continue abs_path = to_native_path_linux(join_path(root, f)) rela_paths.add(abs_path.replace(to_native_path_linux(repo.git_dir) + '/', "")) # END for each file in root directory -- cgit v1.2.3