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

[PATCH] fast-import: use hashcmp() for SHA1 hash comparison

From
René Scharfe <l.s.r@web.de>
Date
Jul 18, 2014, 16:00 UTC
Message-ID
<53C944B3.5080106@web.de>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
---
 fast-import.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fast-import.c b/fast-import.c
index fa635f7..d73f58c 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -2324,7 +2324,7 @@ static void file_change_m(const char *p, struct branch *b)
 	}
 
 	/* Git does not track empty, non-toplevel directories. */
-	if (S_ISDIR(mode) && !memcmp(sha1, EMPTY_TREE_SHA1_BIN, 20) && *p) {
+	if (S_ISDIR(mode) && !hashcmp(sha1, EMPTY_TREE_SHA1_BIN) && *p) {
 		tree_content_remove(&b->branch_tree, p, NULL, 0);
 		return;
 	}
-- 
2.0.2
Next: Jonathan Nieder
Message 1 of 7 in “fast-import: use hashcmp() for SHA1 hash comparison”
  1. fast-import: use hashcmp() for SHA1 hash comparisonRené Scharfe, Jul 18, 2014
  2. Jonathan NiederJul 18, 2014
  3. René ScharfeJul 18, 2014
  4. Jeff KingJul 18, 2014
  5. René ScharfeJul 19, 2014
  6. brian m. carlsonJul 19, 2014
  7. René ScharfeJul 19, 2014

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.