Skip to content

Commit

Permalink
t3305: make hash agnostic
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bk2204 authored and gitster committed Jul 30, 2020
1 parent d827bce commit 9e3bd8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion t/t3305-notes-fanout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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\}$"
}

Expand Down

0 comments on commit 9e3bd8a

Please sign in to comment.