Skip to content

Commit bba5fcc

Browse files
j6tgitster
authored andcommitted
t5000 on Windows: do not mistake "sh.exe" as "sh"
In their effort to emulate POSIX as close as possible, the MSYS tools and Cygwin treat the file name "foo.exe" as "foo" when the latter is asked for, but not present, but the former is present. Following this rule, 'cp /bin/sh a/bin' actually copies the file /bin/sh.exe, so that we now have a/bin/sh.exe in the repository. This difference did not matter in the tests in the past because we were only interested in the equality of contents generated in various ways. But recently added tests check file names, in particular, the presence of "a/bin/sh". This test fails on Windows, as we do not have a file by this name, but "a/bin/sh.exe". Use test-genrandom to generate the large binary file in the repository under the expected name. We could change the guilty line to 'cat /bin/sh >a/bin/sh', but it is better for test reproducibility to ensure that the test data is the same across platforms, which test-genrandom can guarantee. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 7fa1365 commit bba5fcc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

t/t5000-tar-tree.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ test_expect_success \
101101
ten=0123456789 && hundred=$ten$ten$ten$ten$ten$ten$ten$ten$ten$ten &&
102102
echo long filename >a/four$hundred &&
103103
mkdir a/bin &&
104-
cp /bin/sh a/bin &&
104+
test-genrandom "frotz" 500000 >a/bin/sh &&
105105
printf "A\$Format:%s\$O" "$SUBSTFORMAT" >a/substfile1 &&
106106
printf "A not substituted O" >a/substfile2 &&
107107
if test_have_prereq SYMLINKS; then

0 commit comments

Comments
 (0)