diff options
| author | Ben Straub <bstraub@github.com> | 2012-05-11 11:58:02 -0700 |
|---|---|---|
| committer | Ben Straub <bstraub@github.com> | 2012-05-11 11:58:02 -0700 |
| commit | 72b86bae50f3dc0ec1a9df0b62c70ab9bdb37c77 (patch) | |
| tree | 29295940ad3e32664ee8ce8c8aea749e66d7ad99 /src/revparse.c | |
| parent | 92ad5a5cda94c04b24d84c20ede235d69bedb988 (diff) | |
| download | libgit2-72b86bae50f3dc0ec1a9df0b62c70ab9bdb37c77.tar.gz | |
Rev-parse: better error handling for chaining.
Fixed an error where "nonexistant^N" or similar
would fall into an assert. This now properly returns
an error.
Diffstat (limited to 'src/revparse.c')
| -rw-r--r-- | src/revparse.c | 5 |
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; |
