diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2019-08-18 19:16:36 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-08-20 18:09:21 (GMT) |
commit | e3e9d02e35c2d29e9249c99e0efc6213cfaf1557 (patch) | |
tree | f36aa35e3210953baf14ff0aad8e06fd913da3b2 | |
parent | b408cf8cf67fdefa3cf72469599a407544624357 (diff) | |
download | git-e3e9d02e35c2d29e9249c99e0efc6213cfaf1557.zip git-e3e9d02e35c2d29e9249c99e0efc6213cfaf1557.tar.gz git-e3e9d02e35c2d29e9249c99e0efc6213cfaf1557.tar.bz2 |
t3305: make hash size independent
Instead of hard-coding 40-character shell patterns, use grep to
determine if all of the paths have either zero or one levels of fanout,
as appropriate.
Note that the final test is implicitly dependent on the hash algorithm.
Depending on the algorithm in use, the fanout may or may not completely
compress. In its current state, this is not a problem, but it could be
if the hash algorithm changes again.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-x | t/t3305-notes-fanout.sh | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/t/t3305-notes-fanout.sh b/t/t3305-notes-fanout.sh index 54460be..831f83d 100755 --- a/t/t3305-notes-fanout.sh +++ b/t/t3305-notes-fanout.sh @@ -35,15 +35,10 @@ test_expect_success 'many notes created with git-notes triggers fanout' ' git ls-tree -r --name-only refs/notes/commits | while read path do - case "$path" in - ??/??????????????????????????????????????) - : true - ;; - *) + echo $path | grep "^../[0-9a-f]*$" || { echo "Invalid path \"$path\"" && - return 1 - ;; - esac + return 1; + } done ' @@ -77,15 +72,10 @@ test_expect_success 'deleting most notes triggers fanout consolidation' ' git ls-tree -r --name-only refs/notes/commits | while read path do - case "$path" in - ????????????????????????????????????????) - : true - ;; - *) + echo $path | grep -v "^../.*" || { echo "Invalid path \"$path\"" && - return 1 - ;; - esac + return 1; + } done ' |