Merge branch 'jt/fetch-no-redundant-tag-fetch-map'
[gitweb.git] / t / t1301-shared-repo.sh
index ac108754088d34758a75f14943516c4a701f0ca8..1312004f8c8ab11b5aafe0eb1f1fb02f1e4f61d5 100755 (executable)
@@ -172,4 +172,45 @@ test_expect_success POSIXPERM 'forced modes' '
        }" actual)"
 '
 
+test_expect_success POSIXPERM 'remote init does not use config from cwd' '
+       git config core.sharedrepository 0666 &&
+       umask 0022 &&
+       git init --bare child.git &&
+       echo "-rw-r--r--" >expect &&
+       modebits child.git/config >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success POSIXPERM 're-init respects core.sharedrepository (local)' '
+       git config core.sharedrepository 0666 &&
+       umask 0022 &&
+       echo whatever >templates/foo &&
+       git init --template=templates &&
+       echo "-rw-rw-rw-" >expect &&
+       modebits .git/foo >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success POSIXPERM 're-init respects core.sharedrepository (remote)' '
+       rm -rf child.git &&
+       umask 0022 &&
+       git init --bare --shared=0666 child.git &&
+       test_path_is_missing child.git/foo &&
+       git init --bare --template=../templates child.git &&
+       echo "-rw-rw-rw-" >expect &&
+       modebits child.git/foo >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success POSIXPERM 'template can set core.sharedrepository' '
+       rm -rf child.git &&
+       umask 0022 &&
+       git config core.sharedrepository 0666 &&
+       cp .git/config templates/config &&
+       git init --bare --template=../templates child.git &&
+       echo "-rw-rw-rw-" >expect &&
+       modebits child.git/HEAD >actual &&
+       test_cmp expect actual
+'
+
 test_done