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

[PATCH] get-tar-commit-id: use TYPEFLAG_GLOBAL_HEADER instead of magic value

From
René Scharfe <l.s.r@web.de>
Date
Apr 8, 2023, 10:25 UTC
Message-ID
<79497392-0296-2ae3-2560-1f90c1a309b5@web.de>

Use the same macro in the archive reader code as on the writer side in archive-tar.c to document the connection.

Signed-off-by: René Scharfe <l.s.r@web.de>
---
 builtin/get-tar-commit-id.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/get-tar-commit-id.c b/builtin/get-tar-commit-id.c
index d5b871b21d..564cfcac4f 100644
--- a/builtin/get-tar-commit-id.c
+++ b/builtin/get-tar-commit-id.c
@@ -35,7 +35,7 @@ int cmd_get_tar_commit_id(int argc, const char **argv UNUSED, const char *prefix
 		die_errno("git get-tar-commit-id: read error");
 	if (n != HEADERSIZE)
 		die_errno("git get-tar-commit-id: EOF before reading tar header");
-	if (header->typeflag[0] != 'g')
+	if (header->typeflag[0] != TYPEFLAG_GLOBAL_HEADER)
 		return 1;

 	len = strtol(content, &end, 10);
--
2.40.0
Message 1 of 1 in “get-tar-commit-id: use TYPEFLAG_GLOBAL_HEADER instead of magic value”
  1. get-tar-commit-id: use TYPEFLAG_GLOBAL_HEADER instead of magic valueRené Scharfe, Apr 8, 2023

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.