X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft1300-repo-config.sh;h=d0e55465ff08698376f5d9fa86357d51bd57458c;hb=5c28a8b054cb69a37638b0261fc370422c8fab58;hp=d0ab8ffe1b91a7fa37dfc7939cb3d5ae2c3cc100;hpb=acbaf54f3030854b54f8391f7d1ca11935a75518;p=git.git diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index d0ab8ffe1..d0e55465f 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -288,6 +288,14 @@ EOF test_expect_success 'working --list' \ 'git config --list > output && cmp output expect' +cat > expect << EOF +EOF + +test_expect_success '--list without repo produces empty output' ' + git --git-dir=nonexistent config --list >output && + test_cmp expect output +' + cat > expect << EOF beta.noindent sillyValue nextsection.nonewline wow2 for me @@ -836,6 +844,27 @@ test_expect_success SYMLINKS 'symlinked configuration' ' ' +test_expect_success 'nonexistent configuration' ' + ( + GIT_CONFIG=doesnotexist && + export GIT_CONFIG && + test_must_fail git config --list && + test_must_fail git config test.xyzzy + ) +' + +test_expect_success SYMLINKS 'symlink to nonexistent configuration' ' + ln -s doesnotexist linktonada && + ln -s linktonada linktolinktonada && + ( + GIT_CONFIG=linktonada && + export GIT_CONFIG && + test_must_fail git config --list && + GIT_CONFIG=linktolinktonada && + test_must_fail git config --list + ) +' + test_expect_success 'check split_cmdline return' " git config alias.split-cmdline-fix 'echo \"' && test_must_fail git split-cmdline-fix &&