@matheusbsbs / matheus-bagliano / commits / 9e3bd8a391
Fork 0

t3305: make hash agnostic

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>

brian m. carlson committed Jul 29, 2020 at 23:13 UTC 9e3bd8a391a3a2a486e4cff6ff7b4de2bac5a15d
1 file changed +1 -1
t/t3305-notes-fanout.sh
+1 -1
@@ -7,7 +7,7 @@ test_description='Test that adding/removing many notes triggers automatic fanout
7 path_has_fanout() {
8 path=$1 &&
9 fanout=$2 &&
10 - after_last_slash=$((40 - $fanout * 2)) &&
10 + after_last_slash=$(($(test_oid hexsz) - $fanout * 2)) &&
11 echo $path | grep -q "^\([0-9a-f]\{2\}/\)\{$fanout\}[0-9a-f]\{$after_last_slash\}$"
12 }
13