aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-04-03 12:29:45 -0700
committerJunio C Hamano <gitster@pobox.com>2011-04-03 12:29:45 -0700
commit625589b5bebb95a13732c15b7c680c8b1540035b (patch)
treee7a5efce2d4e614050f086d461d1923aed5c2838 /t
parentebae9ff95de2d0b36b061c7db833df4f7e01a41d (diff)
parent2169ddc056b56deba701cbbba28cdaf2e9821224 (diff)
downloadgit-625589b5bebb95a13732c15b7c680c8b1540035b.tar.gz
git-625589b5bebb95a13732c15b7c680c8b1540035b.tar.xz
Merge branch 'lp/config-vername-check' into maint
* 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