Make git-clone respect branch.autosetuprebase
[gitweb.git] / t / t5601-clone.sh
index fe287d31fb98237b11ccc1d1209001dec3fb0a8e..2335d8bc850b4b0010fcb9ac64a25d0c205e8a42 100755 (executable)
@@ -144,4 +144,34 @@ test_expect_success 'clone to an existing path' '
        test_must_fail git clone src target-5
 '
 
+test_expect_success 'clone a void' '
+       mkdir src-0 &&
+       (
+               cd src-0 && git init
+       ) &&
+       git clone src-0 target-6 &&
+       (
+               cd src-0 && test_commit A
+       ) &&
+       git clone src-0 target-7 &&
+       # There is no reason to insist they are bit-for-bit
+       # identical, but this test should suffice for now.
+       test_cmp target-6/.git/config target-7/.git/config
+'
+
+test_expect_success 'clone respects global branch.autosetuprebase' '
+       (
+               HOME=$(pwd) &&
+               export HOME &&
+               test_config="$HOME/.gitconfig" &&
+               unset GIT_CONFIG_NOGLOBAL &&
+               git config -f "$test_config" branch.autosetuprebase remote &&
+               rm -fr dst &&
+               git clone src dst &&
+               cd dst &&
+               actual="z$(git config branch.master.rebase)" &&
+               test ztrue = $actual
+       )
+'
+
 test_done