diff options
author | nulltoken <emeric.fermas@gmail.com> | 2013-02-02 17:36:20 +0100 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2013-02-03 11:18:24 +0100 |
commit | 545b479a07a56676def87fc18878c0b7a9794990 (patch) | |
tree | 09544820c4f7dc1c2923b589757590342773799d /src/revparse.c | |
parent | e963166019de3dca72d18bd4ee8f81519e97fdf3 (diff) | |
download | libgit2-545b479a07a56676def87fc18878c0b7a9794990.tar.gz |
revparse: Lookup branch before described tag
Fix #1306
Diffstat (limited to 'src/revparse.c')
-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 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; |