summaryrefslogtreecommitdiff
path: root/lib/git/refs.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/git/refs.py')
-rw-r--r--lib/git/refs.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/git/refs.py b/lib/git/refs.py
index 8b773ae7..be094d01 100644
--- a/lib/git/refs.py
+++ b/lib/git/refs.py
@@ -208,9 +208,8 @@ class SymbolicReference(object):
try:
write_value = ref.commit.hexsha
except AttributeError:
- sha = str(ref)
try:
- obj = Object.new_from_sha(self.repo, hex_to_bin(sha))
+ obj = self.repo.rev_parse(ref+"^{}") # optionally deref tags
if obj.type != "commit":
raise TypeError("Invalid object type behind sha: %s" % sha)
write_value = obj.hexsha