]> git.ipfire.org Git - thirdparty/git.git/commitdiff
get-tar-commit-id: use TYPEFLAG_GLOBAL_HEADER instead of magic value
authorRené Scharfe <l.s.r@web.de>
Sat, 8 Apr 2023 10:25:04 +0000 (12:25 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Apr 2023 16:22:34 +0000 (09:22 -0700)
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/get-tar-commit-id.c

index 491af9202dc937339db83980e2bf96de6ff81646..453a411f3ce712e1cce0103c5919ddc81c226754 100644 (file)
@@ -32,7 +32,7 @@ int cmd_get_tar_commit_id(int argc, const char **argv, 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);