Skip to content

Commit d344d1c

Browse files
peffgitster
authored andcommitted
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>
1 parent a0262c5 commit d344d1c

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

ref-filter.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,9 +1523,7 @@ static enum contains_result contains_test(struct commit *candidate,
15231523
return CONTAINS_YES;
15241524
}
15251525

1526-
if (parse_commit(candidate) < 0)
1527-
return CONTAINS_NO;
1528-
1526+
parse_commit_or_die(candidate);
15291527
return CONTAINS_UNKNOWN;
15301528
}
15311529

0 commit comments

Comments
 (0)