diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-12-04 10:15:41 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-12-04 10:15:41 +0100 |
commit | 8e29a91324ca7086b948a9e3a4dbcbb2254a24a7 (patch) | |
tree | 8b41d0d5d44652a45dd056766cca7ea005b1a830 /lib/git/refs.py | |
parent | e4ed59a86909b142ede105dd9262915c0e2993ac (diff) | |
download | gitpython-8e29a91324ca7086b948a9e3a4dbcbb2254a24a7.tar.gz |
refs: Fixed incorrect retrieval of symbolic reference types - previously we only really knew heads, now we know references as a common base. The adjustment make the ref system as flexible as it was originally meant to be
Diffstat (limited to 'lib/git/refs.py')
-rw-r--r-- | lib/git/refs.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/git/refs.py b/lib/git/refs.py index 45e6dcfb..96c30cd2 100644 --- a/lib/git/refs.py +++ b/lib/git/refs.py @@ -119,7 +119,7 @@ class SymbolicReference(object): # Otherwise it would have detached it if tokens[0] != "ref:": raise ValueError("Failed to parse symbolic refernce: wanted 'ref: <hexsha>', got %r" % value) - return Head(self.repo, tokens[1]).commit + return Reference.from_path(self.repo, tokens[1]).commit def _set_commit(self, commit): """ @@ -149,13 +149,13 @@ class SymbolicReference(object): def _set_reference(self, ref): """ - Set ourselves to the given ref. It will stay a symbol if the ref is a Head. + Set ourselves to the given ref. It will stay a symbol if the ref is a Reference. Otherwise we try to get a commit from it using our interface. Strings are allowed but will be checked to be sure we have a commit """ write_value = None - if isinstance(ref, Head): + if isinstance(ref, SymbolicReference): write_value = "ref: %s" % ref.path elif isinstance(ref, Commit): write_value = ref.sha |