Thread (19 messages) 19 messages, 1 author, 2016-06-15

[PATCH 10/18] Make fsck_tag() warn-friendly

flat view
DORMANTno replies SUPERSEDED

From: Johannes Schindelin <hidden>
Date: 2016-06-15 23:03:14
Subsystem: the rest · Maintainer: Linus Torvalds

Revision v1 of 7 in this series.

Revisions (7)
  1. v1 current
  2. v2 [diff vs current]
  3. v3 [diff vs current]
  4. v4 [diff vs current]
  5. v5 [diff vs current]
  6. v6 [diff vs current]
  7. v7 [diff vs current]
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 <redacted>
---
 fsck.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fsck.c b/fsck.c
index 21ff35b..c1e7a85 100644
--- a/fsck.c
+++ b/fsck.c
@@ -604,7 +604,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_INVALID_OBJECT_SHA1, "invalid 'object' line format - bad sha1");
-		goto done;
+		if (ret)
+			goto done;
 	}
 	buffer += 41;
 
-- 
2.0.0.rc3.9669.g840d1f9
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help