summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2017-03-09 08:29:04 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-03-10 11:51:30 -0800
commitd344d1cb8a1d1bea268ec78f5d7315381a0a6c96 (patch)
tree5a96072bb00c6580ee579141cdac003129d4870c
parentref-filter: use contains_result enum consistently (diff)
downloadtgif-d344d1cb8a1d1bea268ec78f5d7315381a0a6c96.tar.xz
ref-filter: die on parse_commit errors
The tag-contains algorithm quietly returns "does not contain" when parse_commit() fails. But a parse failure is an indication that the repository is corrupt. We should die loudly rather than producing a bogus result. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--ref-filter.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/ref-filter.c b/ref-filter.c
index 631978a4f9..5cb49b7c24 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -1523,9 +1523,7 @@ static enum contains_result contains_test(struct commit *candidate,
return CONTAINS_YES;
}
- if (parse_commit(candidate) < 0)
- return CONTAINS_NO;
-
+ parse_commit_or_die(candidate);
return CONTAINS_UNKNOWN;
}