diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-10-27 11:58:20 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-10-27 11:58:20 +0100 |
commit | 22757ed7b58862cccef64fdc09f93ea1ac72b1d2 (patch) | |
tree | 943038de3caac80d35b774e33cb2899b2856bbdf /lib/git/refs.py | |
parent | 2792e534dd55fe03bca302f87a3ea638a7278bf1 (diff) | |
download | gitpython-22757ed7b58862cccef64fdc09f93ea1ac72b1d2.tar.gz |
put _make_file helper method into TestBase class
remote: prepared FetchInfo class to be returned by fetch and pull. About to implement tests
Diffstat (limited to 'lib/git/refs.py')
-rw-r--r-- | lib/git/refs.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/git/refs.py b/lib/git/refs.py index 26e7c09e..52e128b5 100644 --- a/lib/git/refs.py +++ b/lib/git/refs.py @@ -263,11 +263,13 @@ class SymbolicReference(object): tokens = value.split(" ") # it is a detached reference - if len(tokens) == 1 and len(tokens[0]) == 40: + if self.repo.re_hexsha_only.match(tokens[0]): return Commit(self.repo, tokens[0]) # must be a head ! Git does not allow symbol refs to other things than heads # 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 def _set_commit(self, commit): |