summaryrefslogtreecommitdiff
path: root/src/revparse.c
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2013-02-02 17:36:20 +0100
committernulltoken <emeric.fermas@gmail.com>2013-02-03 11:18:24 +0100
commit545b479a07a56676def87fc18878c0b7a9794990 (patch)
tree09544820c4f7dc1c2923b589757590342773799d /src/revparse.c
parente963166019de3dca72d18bd4ee8f81519e97fdf3 (diff)
downloadlibgit2-545b479a07a56676def87fc18878c0b7a9794990.tar.gz
revparse: Lookup branch before described tag
Fix #1306
Diffstat (limited to 'src/revparse.c')
-rw-r--r--src/revparse.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/revparse.c b/src/revparse.c
index 05ee1c57d..7c5d9bd79 100644
--- a/src/revparse.c
+++ b/src/revparse.c
@@ -126,13 +126,6 @@ static int revparse_lookup_object(git_object **out, git_repository *repo, const
int error;
git_reference *ref;
- error = maybe_describe(out, repo, spec);
- if (!error)
- return 0;
-
- if (error < 0 && error != GIT_ENOTFOUND)
- return error;
-
error = disambiguate_refname(&ref, repo, spec);
if (!error) {
error = git_object_lookup(out, repo, git_reference_target(ref), GIT_OBJ_ANY);
@@ -143,6 +136,13 @@ static int revparse_lookup_object(git_object **out, git_repository *repo, const
if (error < 0 && error != GIT_ENOTFOUND)
return error;
+ error = maybe_describe(out, repo, spec);
+ if (!error)
+ return 0;
+
+ if (error < 0 && error != GIT_ENOTFOUND)
+ return error;
+
error = maybe_sha_or_abbrev(out, repo, spec);
if (!error)
return 0;