revparse: fix propagation of error
diff --git a/src/revparse.c b/src/revparse.c
index 2631e50..777dee6 100644
--- a/src/revparse.c
+++ b/src/revparse.c
@@ -151,7 +151,7 @@ static int revparse_lookup_object(git_object **out, git_repository *repo, const
if (!error) {
error = git_object_lookup(out, repo, git_reference_oid(ref), GIT_OBJ_ANY);
git_reference_free(ref);
- return 0;
+ return error;
}
if (error < 0 && error != GIT_ENOTFOUND)