diff options
author | Carlos Martín Nieto <carlos@cmartin.tk> | 2012-04-26 15:05:07 +0200 |
---|---|---|
committer | Carlos Martín Nieto <carlos@cmartin.tk> | 2012-04-26 15:38:42 +0200 |
commit | 3aa351ea0fa0d9e8d155801cdac1e83d3b1717c1 (patch) | |
tree | 9b2d8994245744ca0d2c2d07ef2d61e420451172 /src/commit.c | |
parent | eb3d71a5bcd78cb4840e62194e8998141508af88 (diff) | |
download | libgit2-3aa351ea0fa0d9e8d155801cdac1e83d3b1717c1.tar.gz |
error handling: move the missing parts over to the new error handling
Diffstat (limited to 'src/commit.c')
-rw-r--r-- | src/commit.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/commit.c b/src/commit.c index 25db5c07b..04f37fe16 100644 --- a/src/commit.c +++ b/src/commit.c @@ -310,8 +310,10 @@ int git_commit_parent(git_commit **parent, git_commit *commit, unsigned int n) assert(commit); parent_oid = git_vector_get(&commit->parent_oids, n); - if (parent_oid == NULL) - return git__throw(GIT_ENOTFOUND, "Parent %u does not exist", n); + if (parent_oid == NULL) { + giterr_set(GITERR_INVALID, "Parent %u does not exist", n); + return GIT_ENOTFOUND; + } return git_commit_lookup(parent, commit->object.repo, parent_oid); } |