From 367068e0dd1b7d6b5b4029749b326c6bad172498 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Thu, 24 Oct 2013 04:54:01 -0400 Subject: 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 Signed-off-by: Junio C Hamano --- upload-pack.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'upload-pack.c') diff --git a/upload-pack.c b/upload-pack.c index 127e59a60..c107686ce 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -694,8 +694,7 @@ static void receive_needs(void) /* make sure the real parents are parsed */ unregister_shallow(object->sha1); object->parsed = 0; - if (parse_commit((struct commit *)object)) - die("invalid commit"); + parse_commit_or_die((struct commit *)object); parents = ((struct commit *)object)->parents; while (parents) { add_object_array(&parents->item->object, -- cgit v1.2.1