summaryrefslogtreecommitdiff
path: root/t/t1300-repo-config.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2011-02-27 21:58:31 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-02-27 21:58:31 -0800
commitfbfeeaf29480a3299fa6c3349b7a8c1b147c18c5 (patch)
tree4e7060b4640e33114131dff5c8df78dc60470ef9 /t/t1300-repo-config.sh
parentMerge branch 'mg/placeholders-are-lowercase' (diff)
parentDisallow empty section and variable names (diff)
downloadtgif-fbfeeaf29480a3299fa6c3349b7a8c1b147c18c5.tar.xz
Merge branch 'lp/config-vername-check'
* lp/config-vername-check: Disallow empty section and variable names Sanity-check config variable names
Diffstat (limited to 't/t1300-repo-config.sh')
-rwxr-xr-xt/t1300-repo-config.sh22
1 files changed, 18 insertions, 4 deletions
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index d0e55465ff..53fb8228cf 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