summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-07-19 16:45:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-07-19 16:45:21 (GMT)
commitfe01ef31b79af85ca50738b11b048e3fad856d34 (patch)
tree0083d9d0b45381ff59856ba612f7f1b851a31a76 /t
parent20a80d04a4835dfec2823570719f17b6892e4841 (diff)
parentf77bccaeba7a4c542e9b89d144af74bddd36fd08 (diff)
downloadgit-fe01ef31b79af85ca50738b11b048e3fad856d34.zip
git-fe01ef31b79af85ca50738b11b048e3fad856d34.tar.gz
git-fe01ef31b79af85ca50738b11b048e3fad856d34.tar.bz2
Merge branch 'jk/maint-config-param'
* 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