diff options
| author | nulltoken <emeric.fermas@gmail.com> | 2012-07-12 11:46:20 +0200 |
|---|---|---|
| committer | nulltoken <emeric.fermas@gmail.com> | 2012-07-12 22:30:00 +0200 |
| commit | d1b7921a48161cf6fe5bb85a5da4c0bdac3c0df7 (patch) | |
| tree | d0c1c36e5d2b382591c0a1cb6be90617d3bf5f1d /src | |
| parent | bb89cf9478bd6c1c5df1fbda2d82cc86a3ba5aed (diff) | |
| download | libgit2-d1b7921a48161cf6fe5bb85a5da4c0bdac3c0df7.tar.gz | |
revparse: fix disambiguation of refs and abbrev oids
Diffstat (limited to 'src')
| -rw-r--r-- | src/revparse.c | 14 |
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; } |
