]> git.ipfire.org Git - thirdparty/git.git/commitdiff
builtin/show-index: replace sha1_to_hex
authorbrian m. carlson <sandals@crustytoothpaste.net>
Sun, 18 Aug 2019 20:04:26 +0000 (20:04 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 19 Aug 2019 22:04:59 +0000 (15:04 -0700)
In this code path, we use sha1_to_hex to display the contents of a v1
pack index.  While we plan to switch to v3 indices for SHA-256, the v1
pack indices still function, so to support both algorithms, switch
sha1_to_hex to hash_to_hex.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/show-index.c

index e95b84e8ebcbce32e7d8d71004c8b7662ef092f1..0826f6a5a2c2207d1a17070f0f246cc999f31104 100644 (file)
@@ -42,7 +42,7 @@ int cmd_show_index(int argc, const char **argv, const char *prefix)
                        if (fread(entry, 4 + hashsz, 1, stdin) != 1)
                                die("unable to read entry %u/%u", i, nr);
                        offset = ntohl(entry[0]);
-                       printf("%u %s\n", offset, sha1_to_hex((void *)(entry+1)));
+                       printf("%u %s\n", offset, hash_to_hex((void *)(entry+1)));
                }
        } else {
                unsigned off64_nr = 0;