summaryrefslogtreecommitdiff
path: root/src/revparse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/revparse.c')
-rw-r--r--src/revparse.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/revparse.c b/src/revparse.c
index b895b9067..dab74d66a 100644
--- a/src/revparse.c
+++ b/src/revparse.c
@@ -29,9 +29,10 @@ static void set_invalid_syntax_err(const char *spec)
static int revparse_lookup_fully_qualifed_ref(git_object **out, git_repository *repo, const char*spec)
{
git_oid resolved;
+ int error;
- if (git_reference_name_to_oid(&resolved, repo, spec) < 0)
- return GIT_ERROR;
+ if ((error = git_reference_name_to_oid(&resolved, repo, spec)) < 0)
+ return error;
return git_object_lookup(out, repo, &resolved, GIT_OBJ_ANY);
}