t5604: make hash independent
To make our values hash independent, we turn the directory of the object into "Y" and the file name into "Z" after having sorted items by their name. However, when using SHA-256, one of our file names begins with an "a" character, which means it sorts into the wrong place in the list, causing the test to fail. Since we don't care about the order of these items, just sort them after stripping actual hash contents, which means they'll work with any hash algorithm. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
brian m. carlson committed
Dec 21, 2019 at 19:49 UTC
277eb5af7c83f0022a5c95a6d92dfe0c6072fc64
1 file changed
+3
-2
t/t5604-clone-reference.sh
+3
-2
@@ -326,15 +326,16 @@ test_expect_success SYMLINKS 'clone repo with symlinked or unknown files at obje
326
for raw in $(ls T*.raw)
327
do
328
sed -e "s!/../!/Y/!; s![0-9a-f]\{38,\}!Z!" -e "/commit-graph/d" \
329
- -e "/multi-pack-index/d" <$raw >$raw.de-sha || return 1
329
+ -e "/multi-pack-index/d" <$raw >$raw.de-sha-1 &&
330
+ sort $raw.de-sha-1 >$raw.de-sha || return 1
331
done &&
332
333
cat >expected-files <<-EOF &&
334
./Y/Z
335
./Y/Z
336
+ ./Y/Z
337
./a-loose-dir/Z
338
./an-object
337
- ./Y/Z
339
./info/packs
340
./pack/pack-Z.idx
341
./pack/pack-Z.pack