X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft1300-repo-config.sh;h=53fb8228cf18e2b58f3ea63e98a0220fa0fd39f2;hb=625589b5bebb95a13732c15b7c680c8b1540035b;hp=d0e55465ff08698376f5d9fa86357d51bd57458c;hpb=48e0ad033ffd009df1283858ac70ac53660e2d7c;p=git.git diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index d0e55465f..53fb8228c 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -876,11 +876,25 @@ test_expect_success 'check split_cmdline return' " " test_expect_success 'git -c "key=value" support' ' - test "z$(git -c name=value config name)" = zvalue && test "z$(git -c core.name=value config core.name)" = zvalue && - test "z$(git -c CamelCase=value config camelcase)" = zvalue && - test "z$(git -c flag config --bool flag)" = ztrue && - test_must_fail git -c core.name=value config name + test "z$(git -c foo.CamelCase=value config foo.camelcase)" = zvalue && + test "z$(git -c foo.flag config --bool foo.flag)" = ztrue && + test_must_fail git -c name=value config core.name +' + +test_expect_success 'key sanity-checking' ' + test_must_fail git config foo=bar && + test_must_fail git config foo=.bar && + test_must_fail git config foo.ba=r && + test_must_fail git config foo.1bar && + test_must_fail git config foo."ba + z".bar && + test_must_fail git config . false && + test_must_fail git config .foo false && + test_must_fail git config foo. false && + test_must_fail git config .foo. false && + git config foo.bar true && + git config foo."ba =z".bar false ' test_done