dir.c: fix missing dir invalidation in untracked code
[gitweb.git] / t / t5601-clone.sh
index d96b8e737999aeb411bd99b892ef9bc2d36d5e65..0f895478f02bcf4cc4408ce065e79e0314b66793 100755 (executable)
@@ -316,6 +316,7 @@ test_expect_success 'set up ssh wrapper' '
 '
 
 copy_ssh_wrapper_as () {
+       rm -f "${1%$X}$X" &&
        cp "$TRASH_DIRECTORY/ssh$X" "${1%$X}$X" &&
        test_when_finished "rm $(git rev-parse --sq-quote "${1%$X}$X")" &&
        GIT_SSH="${1%$X}$X" &&
@@ -364,9 +365,10 @@ test_expect_success 'OpenSSH variant passes -4' '
        expect_ssh "-4 -p 123" myhost src
 '
 
-test_expect_success 'variant can be overriden' '
-       git -c ssh.variant=simple clone -4 "[myhost:123]:src" ssh-simple-clone &&
-       expect_ssh myhost src
+test_expect_success 'variant can be overridden' '
+       copy_ssh_wrapper_as "$TRASH_DIRECTORY/putty" &&
+       git -c ssh.variant=putty clone -4 "[myhost:123]:src" ssh-putty-clone &&
+       expect_ssh "-4 -P 123" myhost src
 '
 
 test_expect_success 'variant=auto picks based on basename' '
@@ -375,15 +377,20 @@ test_expect_success 'variant=auto picks based on basename' '
        expect_ssh "-4 -P 123" myhost src
 '
 
-test_expect_success 'simple is treated as simple' '
+test_expect_success 'simple does not support -4/-6' '
        copy_ssh_wrapper_as "$TRASH_DIRECTORY/simple" &&
-       git clone -4 "[myhost:123]:src" ssh-bracket-clone-simple &&
-       expect_ssh myhost src
+       test_must_fail git clone -4 "myhost:src" ssh-4-clone-simple
+'
+
+test_expect_success 'simple does not support port' '
+       copy_ssh_wrapper_as "$TRASH_DIRECTORY/simple" &&
+       test_must_fail git clone "[myhost:123]:src" ssh-bracket-clone-simple
 '
 
 test_expect_success 'uplink is treated as simple' '
        copy_ssh_wrapper_as "$TRASH_DIRECTORY/uplink" &&
-       git clone "[myhost:123]:src" ssh-bracket-clone-uplink &&
+       test_must_fail git clone "[myhost:123]:src" ssh-bracket-clone-uplink &&
+       git clone "myhost:src" ssh-clone-uplink &&
        expect_ssh myhost src
 '