aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-02-27 21:58:31 -0800
committerJunio C Hamano <gitster@pobox.com>2011-02-27 21:58:31 -0800
commitfbfeeaf29480a3299fa6c3349b7a8c1b147c18c5 (patch)
tree4e7060b4640e33114131dff5c8df78dc60470ef9 /t
parentecd75ddb6f3fb7f2424d5852bcb4f50896cdcc9d (diff)
parent2169ddc056b56deba701cbbba28cdaf2e9821224 (diff)
downloadgit-fbfeeaf29480a3299fa6c3349b7a8c1b147c18c5.tar.gz
git-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')
-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 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