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>
This commit is contained in:
parent
a0262c51d0
commit
d344d1cb8a
@ -1523,9 +1523,7 @@ static enum contains_result contains_test(struct commit *candidate,
|
|||||||
return CONTAINS_YES;
|
return CONTAINS_YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parse_commit(candidate) < 0)
|
parse_commit_or_die(candidate);
|
||||||
return CONTAINS_NO;
|
|
||||||
|
|
||||||
return CONTAINS_UNKNOWN;
|
return CONTAINS_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user