summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-09-12 04:53:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-09-12 04:53:13 (GMT)
commiteff7c32cfd12867000d6449d335fad0e7c9751f1 (patch)
tree392708c905f6d77ea5052dee5f1b76e7fe7f0a31 /t
parent7baf32a829e6e253f8b3b683da470be36b54c377 (diff)
parentf77bccaeba7a4c542e9b89d144af74bddd36fd08 (diff)
downloadgit-eff7c32cfd12867000d6449d335fad0e7c9751f1.zip
git-eff7c32cfd12867000d6449d335fad0e7c9751f1.tar.gz
git-eff7c32cfd12867000d6449d335fad0e7c9751f1.tar.bz2
Merge branch 'jk/maint-config-param' into maint
* jk/maint-config-param: config: use strbuf_split_str instead of a temporary strbuf strbuf: allow strbuf_split to work on non-strbufs config: avoid segfault when parsing command-line config config: die on error in command-line config fix "git -c" parsing of values with equals signs strbuf_split: add a max parameter
Diffstat (limited to 't')
-rwxr-xr-xt/t1300-repo-config.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index 3db5626..3e140c1 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -904,4 +904,22 @@ test_expect_success 'git -c works with aliases of builtins' '
test_cmp expect actual
'
+test_expect_success 'git -c does not split values on equals' '
+ echo "value with = in it" >expect &&
+ git -c core.foo="value with = in it" config core.foo >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'git -c dies on bogus config' '
+ test_must_fail git -c core.bare=foo rev-parse
+'
+
+test_expect_success 'git -c complains about empty key' '
+ test_must_fail git -c "=foo" rev-parse
+'
+
+test_expect_success 'git -c complains about empty key and value' '
+ test_must_fail git -c "" rev-parse
+'
+
test_done