summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/revparse.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/revparse.c b/src/revparse.c
index e35c01add..270bdaa23 100644
--- a/src/revparse.c
+++ b/src/revparse.c
@@ -147,13 +147,6 @@ static int revparse_lookup_object(git_object **out, git_repository *repo, const
if (error < 0 && error != GIT_ENOTFOUND)
return error;
- error = maybe_sha_or_abbrev(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_oid(ref), GIT_OBJ_ANY);
@@ -164,6 +157,13 @@ static int revparse_lookup_object(git_object **out, git_repository *repo, const
if (error < 0 && error != GIT_ENOTFOUND)
return error;
+ error = maybe_sha_or_abbrev(out, repo, spec);
+ if (!error)
+ return 0;
+
+ if (error < 0 && error != GIT_ENOTFOUND)
+ return error;
+
giterr_set(GITERR_REFERENCE, "Refspec '%s' not found.", spec);
return GIT_ENOTFOUND;
}