git rebase --abort: always restore the right commit
[gitweb.git] / t / t5701-clone-local.sh
index 56f9d8ae734b130f3d6b978f00eeeaf8df2a2873..59a165a6d44190a1ce9ef9575dc6c8a2ce9f4efb 100755 (executable)
@@ -8,13 +8,16 @@ D=`pwd`
 test_expect_success 'preparing origin repository' '
        : >file && git add . && git commit -m1 &&
        git clone --bare . a.git &&
-       git clone --bare . x
+       git clone --bare . x &&
+       test "$(GIT_CONFIG=a.git/config git config --bool core.bare)" = true &&
+       test "$(GIT_CONFIG=x/config git config --bool core.bare)" = true
 '
 
 test_expect_success 'local clone without .git suffix' '
        cd "$D" &&
        git clone -l -s a b &&
        cd b &&
+       test "$(GIT_CONFIG=.git/config git config --bool core.bare)" = false &&
        git fetch
 '
 
@@ -60,4 +63,12 @@ test_expect_success 'Even without -l, local will make a hardlink' '
        test 0 = $copied
 '
 
+test_expect_success 'local clone of repo with nonexistent ref in HEAD' '
+       cd "$D" &&
+       echo "ref: refs/heads/nonexistent" > a.git/HEAD &&
+       git clone a d &&
+       cd d &&
+       git fetch &&
+       test ! -e .git/refs/remotes/origin/HEAD'
+
 test_done