summaryrefslogtreecommitdiff
path: root/git/repo/fun.py
diff options
context:
space:
mode:
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)