Skip to content

Commit cff48cc

Browse files
committed
t5601: rm the target file of cp that could still be executing
"while sh t5601-clone.sh; do :; done" seems to fail sporadically at around test #45 where fake-ssh wrapper is copied create plink.exe, with an error message that says the "text is busy". I have a mild suspicion that the root cause of the bug is that the fake SSH process from the previous test is still running by the time the next test wants to replace it with a new binary, but in the meantime, removing the target that could still be executing before copying something else over seems to work it around. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2ac9cf7 commit cff48cc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

t/t5601-clone.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ test_expect_success 'clone checking out a tag' '
308308

309309
setup_ssh_wrapper () {
310310
test_expect_success 'setup ssh wrapper' '
311+
rm -f "$TRASH_DIRECTORY/ssh-wrapper$X" &&
311312
cp "$GIT_BUILD_DIR/t/helper/test-fake-ssh$X" \
312313
"$TRASH_DIRECTORY/ssh-wrapper$X" &&
313314
GIT_SSH="$TRASH_DIRECTORY/ssh-wrapper$X" &&
@@ -318,6 +319,7 @@ setup_ssh_wrapper () {
318319
}
319320

320321
copy_ssh_wrapper_as () {
322+
rm -f "${1%$X}$X" &&
321323
cp "$TRASH_DIRECTORY/ssh-wrapper$X" "${1%$X}$X" &&
322324
GIT_SSH="${1%$X}$X" &&
323325
export GIT_SSH

0 commit comments

Comments
 (0)