summaryrefslogtreecommitdiff
path: root/lib/git/refs.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-06-28 19:15:42 +0200
committerSebastian Thiel <byronimo@gmail.com>2010-06-28 19:15:54 +0200
commit1fe889ea0cb2547584075dc1eb77f52c54b9a8c4 (patch)
treecd3685e0bd87441eab4888efbc4e14a232a65a7b /lib/git/refs.py
parent47e3138ee978ce708a41f38a0d874376d7ae5c78 (diff)
downloadgitpython-1fe889ea0cb2547584075dc1eb77f52c54b9a8c4.tar.gz
All tests adjusted to work with the changed internal sha representation
Diffstat (limited to 'lib/git/refs.py')
-rw-r--r--lib/git/refs.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/git/refs.py b/lib/git/refs.py
index d5fe70c7..8258ca8d 100644
--- a/lib/git/refs.py
+++ b/lib/git/refs.py
@@ -25,7 +25,8 @@ from gitdb.util import (
isdir,
exists,
isfile,
- rename
+ rename,
+ hex_to_bin
)
@@ -147,11 +148,11 @@ class SymbolicReference(object):
Commit object we point to, works for detached and non-detached
SymbolicReferences"""
# we partially reimplement it to prevent unnecessary file access
- sha, target_ref_path = self._get_ref_info()
+ hexsha, target_ref_path = self._get_ref_info()
# it is a detached reference
- if sha:
- return Commit(self.repo, sha)
+ if hexsha:
+ return Commit(self.repo, hex_to_bin(hexsha))
return self.from_path(self.repo, target_ref_path).commit
@@ -402,9 +403,9 @@ class SymbolicReference(object):
os.remove(new_abs_path)
# END handle existing target file
- dirname = dirname(new_abs_path)
- if not isdir(dirname):
- os.makedirs(dirname)
+ dname = dirname(new_abs_path)
+ if not isdir(dname):
+ os.makedirs(dname)
# END create directory
rename(cur_abs_path, new_abs_path)