diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2015-02-19 18:02:35 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2015-02-19 18:02:35 +0100 |
commit | 346424daaaf2bb3936b5f4c2891101763dc2bdc0 (patch) | |
tree | 5950b43a9e63d5b0df68f235d81d25e2e5f0b4a7 | |
parent | 0f5320e8171324a002d3769824152cf5166a21a2 (diff) | |
download | gitpython-346424daaaf2bb3936b5f4c2891101763dc2bdc0.tar.gz |
Assure to not iterate packed-refs file, ever.
Related to #252
-rw-r--r-- | git/refs/symbolic.py | 3 |
1 files changed, 3 insertions, 0 deletions
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 |