summaryrefslogtreecommitdiff
path: root/shallow.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2013-10-24 08:54:01 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-10-24 22:43:51 (GMT)
commit367068e0dd1b7d6b5b4029749b326c6bad172498 (patch)
treee3387b0afa554b0547719b1b8d1d26f0cd821d61 /shallow.c
parent683ff884cce955cc331929d857fac9d6bd69f46a (diff)
downloadgit-367068e0dd1b7d6b5b4029749b326c6bad172498.zip
git-367068e0dd1b7d6b5b4029749b326c6bad172498.tar.gz
git-367068e0dd1b7d6b5b4029749b326c6bad172498.tar.bz2
use parse_commit_or_die instead of custom message
Many calls to parse_commit detect errors and die. In some cases, the custom error messages are more useful than what parse_commit_or_die could produce, because they give some context, like which ref the commit came from. Some, however, just say "invalid commit". Let's convert the latter to use parse_commit_or_die; its message is slightly more informative, and it makes the error more consistent throughout git. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'shallow.c')
-rw-r--r--shallow.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/shallow.c b/shallow.c
index 8a9c96d..a273685 100644
--- a/shallow.c
+++ b/shallow.c
@@ -89,8 +89,7 @@ struct commit_list *get_shallow_commits(struct object_array *heads, int depth,
cur_depth = *(int *)commit->util;
}
}
- if (parse_commit(commit))
- die("invalid commit");
+ parse_commit_or_die(commit);
cur_depth++;
if (cur_depth >= depth) {
commit_list_insert(commit, &result);