Merge branch 'tg/ls-remote-symref'
[gitweb.git] / t / t5700-clone-reference.sh
index ef1779f5cae5642c65c83a9e18b55488005ccf12..4320082b1b8fe709e9462f84d15fec63c54a94d4 100755 (executable)
@@ -6,7 +6,7 @@
 test_description='test clone --reference'
 . ./test-lib.sh
 
-base_dir=`pwd`
+base_dir=$(pwd)
 
 U=$base_dir/UPLOAD_LOG
 
@@ -188,5 +188,37 @@ test_expect_success 'clone and dissociate from reference' '
        test_must_fail git -C R fsck &&
        git -C S fsck
 '
+test_expect_success 'clone, dissociate from partial reference and repack' '
+       rm -fr P Q R &&
+       git init P &&
+       (
+               cd P &&
+               test_commit one &&
+               git repack &&
+               test_commit two &&
+               git repack
+       ) &&
+       git clone --bare P Q &&
+       (
+               cd P &&
+               git checkout -b second &&
+               test_commit three &&
+               git repack
+       ) &&
+       git clone --bare --dissociate --reference=P Q R &&
+       ls R/objects/pack/*.pack >packs.txt &&
+       test_line_count = 1 packs.txt
+'
+
+test_expect_success 'clone, dissociate from alternates' '
+       rm -fr A B C &&
+       test_create_repo A &&
+       commit_in A file1 &&
+       git clone --reference=A A B &&
+       test_line_count = 1 B/.git/objects/info/alternates &&
+       git clone --local --dissociate B C &&
+       ! test -f C/.git/objects/info/alternates &&
+       ( cd C && git fsck )
+'
 
 test_done