Skip to content

Commit 7d7d5b0

Browse files
dschogitster
authored andcommitted
fsck: make fsck_tag() warn-friendly
When fsck_tag() identifies a problem with the commit, it should try to make it possible to continue checking the commit object, in case the user wants to demote the detected errors to mere warnings. Just like fsck_commit(), there are certain problems that could hide other issues with the same tag object. For example, if the 'type' line is not encountered in the correct position, the 'tag' line – if there is any – would not be handled at all. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c9ad147 commit 7d7d5b0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fsck.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,8 @@ static int fsck_tag_buffer(struct tag *tag, const char *data,
643643
}
644644
if (get_sha1_hex(buffer, sha1) || buffer[40] != '\n') {
645645
ret = report(options, &tag->object, FSCK_MSG_BAD_OBJECT_SHA1, "invalid 'object' line format - bad sha1");
646-
goto done;
646+
if (ret)
647+
goto done;
647648
}
648649
buffer += 41;
649650

0 commit comments

Comments
 (0)