]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t/oid-info: allow looking up hash algorithm name
authorbrian m. carlson <sandals@crustytoothpaste.net>
Sat, 5 Oct 2019 21:11:55 +0000 (21:11 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 6 Oct 2019 02:45:29 +0000 (11:45 +0900)
The test_oid function provides a mechanism for looking up hash algorithm
information, but it doesn't specify a way to discover the hash algorithm
name.  Knowing this information is useful if one wants to invoke the
test-tool helper for the algorithm in use, such as in our pack
generation library.

While it's currently possible to inspect the global variable holding
this value, in the future we'll allow specifying an algorithm for
storage and an algorithm for display, so it's better to abstract this
value away.  To assist with this, provide a named entry in the
algorithm-specific lookup table that prints the algorithm in use.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/oid-info/hash-info

index ccdbfdf9743d6adab98bd7b33c55a1b35523eaa7..6b5ded0b34b32fe931591bba3ca06d479b6fca23 100644 (file)
@@ -6,3 +6,6 @@ hexsz sha256:64
 
 zero sha1:0000000000000000000000000000000000000000
 zero sha256:0000000000000000000000000000000000000000000000000000000000000000
+
+algo sha1:sha1
+algo sha256:sha256