X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft0001-init.sh;h=e3d846420dc09e7b24876b291b9e546ac0628ed3;hb=900a5d075e8b48025439966dc3863189874bae3b;hp=620da5b32041b1ad69bfdcb6d139f2705386a5ff;hpb=10d9d887ecdc81197162d7bbe5dfc0d028498fd6;p=git.git diff --git a/t/t0001-init.sh b/t/t0001-init.sh index 620da5b32..e3d846420 100755 --- a/t/t0001-init.sh +++ b/t/t0001-init.sh @@ -167,4 +167,45 @@ test_expect_success 'init with --template (blank)' ' ! test -f template-blank/.git/info/exclude ' +test_expect_success 'init --bare/--shared overrides system/global config' ' + ( + HOME="`pwd`" && + export HOME && + test_config="$HOME"/.gitconfig && + unset GIT_CONFIG_NOGLOBAL && + git config -f "$test_config" core.bare false && + git config -f "$test_config" core.sharedRepository 0640 && + mkdir init-bare-shared-override && + cd init-bare-shared-override && + git init --bare --shared=0666 + ) && + check_config init-bare-shared-override true unset && + test x0666 = \ + x`git config -f init-bare-shared-override/config core.sharedRepository` +' + +test_expect_success 'init honors global core.sharedRepository' ' + ( + HOME="`pwd`" && + export HOME && + test_config="$HOME"/.gitconfig && + unset GIT_CONFIG_NOGLOBAL && + git config -f "$test_config" core.sharedRepository 0666 && + mkdir shared-honor-global && + cd shared-honor-global && + git init + ) && + test x0666 = \ + x`git config -f shared-honor-global/.git/config core.sharedRepository` +' + +test_expect_success 'init rejects insanely long --template' ' + ( + insane=$(printf "x%09999dx" 1) && + mkdir test && + cd test && + test_must_fail git init --template=$insane + ) +' + test_done