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, 4 insertions, 1 deletions
diff --git a/src/revparse.c b/src/revparse.c
index 7cb96b806..3487f5638 100644
--- a/src/revparse.c
+++ b/src/revparse.c
@@ -564,7 +564,10 @@ int git_revparse_single(git_object **out, git_repository *repo, const char *spec
if (current_state != next_state && next_state != REVPARSE_STATE_DONE) {
/* Leaving INIT state, find the object specified, in case that state needs it */
- revparse_lookup_object(&next_obj, repo, git_buf_cstr(&specbuffer));
+ if (revparse_lookup_object(&next_obj, repo, git_buf_cstr(&specbuffer)) < 0) {
+ retcode = GIT_ERROR;
+ next_state = REVPARSE_STATE_DONE;
+ }
}
break;