summaryrefslogtreecommitdiff
path: root/src/commit.c
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-05-23 20:36:06 +0300
committerVicent Marti <tanoku@gmail.com>2011-05-23 20:36:06 +0300
commit4c7a5e9e3f85a5a823cf66c769e502163f1d5e4e (patch)
tree5e6161aaa1557dc3b2cc87ded0b55f577898081f /src/commit.c
parent726c6fd29327700f8af0dc28d13e4802b4af56c7 (diff)
downloadlibgit2-4c7a5e9e3f85a5a823cf66c769e502163f1d5e4e.tar.gz
commit: Reword errors
Diffstat (limited to 'src/commit.c')
-rw-r--r--src/commit.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/commit.c b/src/commit.c
index 0d99c0ef3..bfae0592e 100644
--- a/src/commit.c
+++ b/src/commit.c
@@ -103,8 +103,6 @@ int git_commit_create_v(
free((void *)oids);
- if (error < GIT_SUCCESS)
- return git__rethrow(error, "Failed to create commit");
return error;
}
@@ -137,8 +135,6 @@ int git_commit_create_ov(
free((void *)oids);
- if (error < GIT_SUCCESS)
- return git__rethrow(error, "Failed to create commit");
return error;
}
@@ -168,8 +164,6 @@ int git_commit_create_o(
free((void *)oids);
- if (error < GIT_SUCCESS)
- return git__rethrow(error, "Failed to create commit");
return error;
}
@@ -197,7 +191,7 @@ int git_commit_create(
committer_length = git_signature__write(&committer_str, "committer", committer);
if (author_length < 0 || committer_length < 0)
- return GIT_ENOMEM;
+ return git__throw(GIT_EINVALIDARGS, "Cannot create commit. Failed to parse signature");
final_size += GIT_OID_LINE_LENGTH("tree");
final_size += GIT_OID_LINE_LENGTH("parent") * parent_count;
@@ -252,7 +246,8 @@ int git_commit_create(
if (error < GIT_SUCCESS)
return git__rethrow(error, "Failed to create commit");
- return error;
+
+ return GIT_SUCCESS;
}
int commit_parse_buffer(git_commit *commit, const void *data, size_t len)
@@ -354,7 +349,7 @@ int git_commit_parent(git_commit **parent, git_commit *commit, unsigned int n)
parent_oid = git_vector_get(&commit->parent_oids, n);
if (parent_oid == NULL)
- return git__throw(GIT_ENOTFOUND, "Failed to get parent. Parent does not exist");
+ return git__throw(GIT_ENOTFOUND, "Parent %u does not exist", n);
return git_commit_lookup(parent, commit->object.repo, parent_oid);
}