Skip to content

Commit

Permalink
fsck: make fsck_tag() warn-friendly
Browse files Browse the repository at this point in the history
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 <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed Jun 23, 2015
1 parent c9ad147 commit 7d7d5b0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fsck.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,8 @@ static int fsck_tag_buffer(struct tag *tag, const char *data,
}
if (get_sha1_hex(buffer, sha1) || buffer[40] != '\n') {
ret = report(options, &tag->object, FSCK_MSG_BAD_OBJECT_SHA1, "invalid 'object' line format - bad sha1");
goto done;
if (ret)
goto done;
}
buffer += 41;

Expand Down

0 comments on commit 7d7d5b0

Please sign in to comment.