threads / patch / 59567

patchget-tar-commit-id: use TYPEFLAG_GLOBAL_HEADER instead of magic value

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

## tl;dr

One message between Apr 8, 2023 and Apr 8, 2023. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

René Scharfe· Apr 8, 2023, 10:25 UTC · lore

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(-)
Show changes to builtin/get-tar-commit-id.c +1 −2
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

← back to recent threads