]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t3305: make hash agnostic
authorbrian m. carlson <sandals@crustytoothpaste.net>
Wed, 29 Jul 2020 23:13:52 +0000 (23:13 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 30 Jul 2020 16:16:45 +0000 (09:16 -0700)
When computing the fanout length, let's use test_oid to look up the
hexadecimal size of the hash in question instead of hard-coding a value.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3305-notes-fanout.sh

index 3b4753e1b479bdc9ecddb5a08565e056e9b10b14..94c1b02251c28e68778d8a5c4f1298ec1a84dc52 100755 (executable)
@@ -7,7 +7,7 @@ test_description='Test that adding/removing many notes triggers automatic fanout
 path_has_fanout() {
        path=$1 &&
        fanout=$2 &&
-       after_last_slash=$((40 - $fanout * 2)) &&
+       after_last_slash=$(($(test_oid hexsz) - $fanout * 2)) &&
        echo $path | grep -q "^\([0-9a-f]\{2\}/\)\{$fanout\}[0-9a-f]\{$after_last_slash\}$"
 }