diff mbox series

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

Message ID 79497392-0296-2ae3-2560-1f90c1a309b5@web.de (mailing list archive)
State New, archived
Headers show
Series get-tar-commit-id: use TYPEFLAG_GLOBAL_HEADER instead of magic value | expand

Commit Message

René Scharfe April 8, 2023, 10:25 a.m. UTC
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(-)

--
2.40.0
diff mbox series

Patch

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);