summaryrefslogtreecommitdiff
path: root/git/repo/fun.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2011-02-23 00:06:38 +0100
committerSebastian Thiel <byronimo@gmail.com>2011-02-23 00:06:38 +0100
commit96c7ac239a2c9e303233e58daee02101cc4ebf3d (patch)
tree3ddff6e1f87311fb4846d5fa37b06d9d3d780048 /git/repo/fun.py
parent5eb7fd3f0dd99dc6c49da6fd7e78a392c4ef1b33 (diff)
downloadgitpython-96c7ac239a2c9e303233e58daee02101cc4ebf3d.tar.gz
Fixed incorrect handling of rev_parse if it was fed with branches that looked like hexshas. Thanks to Ning (frostyplanet) who pointed this issue out
Diffstat (limited to 'git/repo/fun.py')
-rw-r--r--git/repo/fun.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/git/repo/fun.py b/git/repo/fun.py
index 7a5984d3..03d55716 100644
--- a/git/repo/fun.py
+++ b/git/repo/fun.py
@@ -59,7 +59,11 @@ def name_to_object(repo, name, return_ref=False):
else:
hexsha = name
# END handle short shas
- else:
+ #END find sha if it matches
+
+ # if we couldn't find an object for what seemed to be a short hexsha
+ # try to find it as reference anyway, it could be named 'aaa' for instance
+ if hexsha is None:
for base in ('%s', 'refs/%s', 'refs/tags/%s', 'refs/heads/%s', 'refs/remotes/%s', 'refs/remotes/%s/HEAD'):
try:
hexsha = SymbolicReference.dereference_recursive(repo, base % name)