aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-09-09 12:53:56 -0700
committerJunio C Hamano <gitster@pobox.com>2014-09-09 12:53:57 -0700
commit93424a0fd882a3ed1c1f7a8b6fe71fdaa21cce99 (patch)
treeb20b3ed1d2c1ecad9d7bc09a6679ed24015dfe36 /t
parent713c6f3ab06fcda921262b718742cff7f208da9a (diff)
parenta789ca70e7a5b02973b116d21674acd795238f99 (diff)
downloadgit-93424a0fd882a3ed1c1f7a8b6fe71fdaa21cce99.tar.gz
git-93424a0fd882a3ed1c1f7a8b6fe71fdaa21cce99.tar.xz
Merge branch 'jk/command-line-config-empty-string'
"git -c section.var command" and "git -c section.var= command" should pass the configuration differently (the former should be a boolean true, the latter should be an empty string). * jk/command-line-config-empty-string: config: teach "git -c" to recognize an empty string
Diffstat (limited to 't')
-rwxr-xr-xt/t1300-repo-config.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index fb871d09c..938fc8bfd 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -1010,6 +1010,17 @@ test_expect_success 'git -c "key=value" support' '
test_must_fail git -c name=value config core.name
'
+# We just need a type-specifier here that cares about the
+# distinction internally between a NULL boolean and a real
+# string (because most of git's internal parsers do care).
+# Using "--path" works, but we do not otherwise care about
+# its semantics.
+test_expect_success 'git -c can represent empty string' '
+ echo >expect &&
+ git -c foo.empty= config --path foo.empty >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'key sanity-checking' '
test_must_fail git config foo=bar &&
test_must_fail git config foo=.bar &&