summaryrefslogtreecommitdiff
path: root/fsck.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2015-06-22 15:26:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-06-23 21:27:35 (GMT)
commit7d7d5b0568e49d9d0dd3b4909572fadca8fc3b06 (patch)
tree9381c13ca102b37dced0efc880ab50d08301fe17 /fsck.c
parentc9ad147f83f70b6add9066e16e1e44c8bc3d5c13 (diff)
downloadgit-7d7d5b0568e49d9d0dd3b4909572fadca8fc3b06.zip
git-7d7d5b0568e49d9d0dd3b4909572fadca8fc3b06.tar.gz
git-7d7d5b0568e49d9d0dd3b4909572fadca8fc3b06.tar.bz2
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 <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fsck.c')
-rw-r--r--fsck.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fsck.c b/fsck.c
index 8dc5867..6635e15 100644
--- a/fsck.c
+++ b/fsck.c
@@ -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;