Skip to content

Commit 277eb5a

Browse files
bk2204gitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 44b6c05 commit 277eb5a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

t/t5604-clone-reference.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,15 +326,16 @@ test_expect_success SYMLINKS 'clone repo with symlinked or unknown files at obje
326326
for raw in $(ls T*.raw)
327327
do
328328
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
330331
done &&
331332
332333
cat >expected-files <<-EOF &&
333334
./Y/Z
334335
./Y/Z
336+
./Y/Z
335337
./a-loose-dir/Z
336338
./an-object
337-
./Y/Z
338339
./info/packs
339340
./pack/pack-Z.idx
340341
./pack/pack-Z.pack

0 commit comments

Comments
 (0)