summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-10-17 14:04:43 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-10-17 14:04:43 +0900
commitcff48ccf2a4fefab6f87b1b6ec9ec63595d88175 (patch)
treef457e38be0a78d935b9d4dcb8e0f2ef2c32084f0
parentCrawling towards -rc2 (diff)
downloadtgif-cff48ccf2a4fefab6f87b1b6ec9ec63595d88175.tar.xz
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 <gitster@pobox.com>
-rwxr-xr-xt/t5601-clone.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 9c56f771b6..50e40abb11 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -308,6 +308,7 @@ test_expect_success 'clone checking out a tag' '
setup_ssh_wrapper () {
test_expect_success 'setup ssh wrapper' '
+ rm -f "$TRASH_DIRECTORY/ssh-wrapper$X" &&
cp "$GIT_BUILD_DIR/t/helper/test-fake-ssh$X" \
"$TRASH_DIRECTORY/ssh-wrapper$X" &&
GIT_SSH="$TRASH_DIRECTORY/ssh-wrapper$X" &&
@@ -318,6 +319,7 @@ setup_ssh_wrapper () {
}
copy_ssh_wrapper_as () {
+ rm -f "${1%$X}$X" &&
cp "$TRASH_DIRECTORY/ssh-wrapper$X" "${1%$X}$X" &&
GIT_SSH="${1%$X}$X" &&
export GIT_SSH