Merge branch 'tr/pty-all'
[gitweb.git] / t / t5601-clone.sh
index 0163ad1e211af8e39606019331b0bc8f43a64b11..87ee01662c2fcfa58d8f9896fd43881e2e7ed7d6 100755 (executable)
@@ -202,12 +202,30 @@ test_expect_success 'clone separate gitdir: output' '
        test_cmp expected dst/.git
 '
 
+test_expect_success 'clone from .git file' '
+       git clone dst/.git dst2
+'
+
+test_expect_success 'fetch from .git gitfile' '
+       (
+               cd dst2 &&
+               git fetch ../dst/.git
+       )
+'
+
+test_expect_success 'fetch from gitfile parent' '
+       (
+               cd dst2 &&
+               git fetch ../dst
+       )
+'
+
 test_expect_success 'clone separate gitdir where target already exists' '
        rm -rf dst &&
        test_must_fail git clone --separate-git-dir realgitdir src dst
 '
 
-test_expect_failure 'clone --reference from original' '
+test_expect_success 'clone --reference from original' '
        git clone --shared --bare src src-1 &&
        git clone --bare src src-2 &&
        git clone --reference=src-2 --bare src-1 target-8 &&
@@ -222,4 +240,12 @@ test_expect_success 'clone with more than one --reference' '
        grep /src-4/ target-9/.git/objects/info/alternates
 '
 
+test_expect_success 'clone from original with relative alternate' '
+       mkdir nest &&
+       git clone --bare src nest/src-5 &&
+       echo ../../../src/.git/objects >nest/src-5/objects/info/alternates &&
+       git clone --bare nest/src-5 target-10 &&
+       grep /src/\\.git/objects target-10/objects/info/alternates
+'
+
 test_done