ref-filter: make remote_ref_atom_parser() use refname_atom_parser_internal()
[gitweb.git] / t / t1301-shared-repo.sh
index 7c28642f2e76046f25a36722e12fe87a5e4cea06..1312004f8c8ab11b5aafe0eb1f1fb02f1e4f61d5 100755 (executable)
@@ -181,4 +181,36 @@ test_expect_success POSIXPERM 'remote init does not use config from cwd' '
        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