git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] git-fsck: remove commit test already done by parse_commit_buffer

From
MKMartin Koegler <mkoegler@auto.tuwien.ac.at>
Date
Jan 13, 2008, 18:11 UTC
Message-ID
<1200247870151-git-send-email-mkoegler@auto.tuwien.ac.at>
In-Reply-To
<12002478702664-git-send-email-mkoegler@auto.tuwien.ac.at>
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
---
 builtin-fsck.c |   12 ------------
 1 files changed, 0 insertions(+), 12 deletions(-)
diff --git a/builtin-fsck.c b/builtin-fsck.c
index e4874f6..a77d8c0 100644
--- a/builtin-fsck.c
+++ b/builtin-fsck.c
@@ -360,18 +360,6 @@ static int fsck_commit(struct commit *commit)
 		fprintf(stderr, "Checking commit %s\n",
 			sha1_to_hex(commit->object.sha1));
 
-	if (memcmp(buffer, "tree ", 5))
-		return objerror(&commit->object, "invalid format - expected 'tree' line");
-	if (get_sha1_hex(buffer+5, tree_sha1) || buffer[45] != '\n')
-		return objerror(&commit->object, "invalid 'tree' line format - bad sha1");
-	buffer += 46;
-	while (!memcmp(buffer, "parent ", 7)) {
-		if (get_sha1_hex(buffer+7, sha1) || buffer[47] != '\n')
-			return objerror(&commit->object, "invalid 'parent' line format - bad sha1");
-		buffer += 48;
-	}
-	if (memcmp(buffer, "author ", 7))
-		return objerror(&commit->object, "invalid format - expected 'author' line");
 	free(commit->buffer);
 	commit->buffer = NULL;
 	if (!commit->tree)
-- 
1.4.4.4
Previous: Martin KoeglerNext: Junio C Hamano
Message 2 of 7 in “parse_commit_buffer: don't parse invalid commits”
  1. 1/2 parse_commit_buffer: don't parse invalid commitsMartin Koegler, Jan 13, 2008
  2. 2/2 git-fsck: remove commit test already done by parse_commit_bufferMartin Koegler, Jan 13, 2008
  3. Junio C HamanoJan 13, 2008
  4. Martin KoeglerJan 14, 2008
  5. Junio C HamanoJan 14, 2008
  6. Martin KoeglerJan 14, 2008
  7. Junio C HamanoJan 14, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.