rebase -i --keep-empty: don't prune empty commits
[gitweb.git] / t / t5601-clone.sh
index 9ae1606ee5139af8c11d31ce2a108299435a9081..8c437bf8721f929155fa2ddab1677c050ae5caca 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" &&
@@ -378,12 +379,18 @@ test_expect_success 'variant=auto picks based on basename' '
 
 test_expect_success 'simple does not support -4/-6' '
        copy_ssh_wrapper_as "$TRASH_DIRECTORY/simple" &&
-       test_must_fail git clone -4 "[myhost:123]:src" ssh-bracket-clone-simple
+       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
 '
 
@@ -604,4 +611,21 @@ test_expect_success 'GIT_TRACE_PACKFILE produces a usable pack' '
        git -C replay.git index-pack -v --stdin <tmp.pack
 '
 
+hex2oct () {
+       perl -ne 'printf "\\%03o", hex for /../g'
+}
+
+test_expect_success 'clone on case-insensitive fs' '
+       git init icasefs &&
+       (
+               cd icasefs
+               o=$(git hash-object -w --stdin </dev/null | hex2oct) &&
+               t=$(printf "100644 X\0${o}100644 x\0${o}" |
+                       git hash-object -w -t tree --stdin) &&
+               c=$(git commit-tree -m bogus $t) &&
+               git update-ref refs/heads/bogus $c &&
+               git clone -b bogus . bogus
+       )
+'
+
 test_done