summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2014-09-29 22:10:25 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-09-29 22:10:25 -0700
commit102edda4dfa3f2119119c2b52c90a9337a03178f (patch)
treec6f34cca5c4935b30fce5cf1c9841ee731db0d4b /t
parentMerge branch 'mk/reachable-protect-detached-head' into maint (diff)
parentconfig: avoid a funny sentinel value "a^" (diff)
downloadtgif-102edda4dfa3f2119119c2b52c90a9337a03178f.tar.xz
Merge branch 'ta/config-add-to-empty-or-true-fix' into maint
"git config --add section.var val" used to lose existing section.var whose value was an empty string. * ta/config-add-to-empty-or-true-fix: config: avoid a funny sentinel value "a^" make config --add behave correctly for empty and NULL values
Diffstat (limited to 't')
-rwxr-xr-xt/t1303-wacky-config.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/t/t1303-wacky-config.sh b/t/t1303-wacky-config.sh
index 3a2c81968c..3b92083e19 100755
--- a/t/t1303-wacky-config.sh
+++ b/t/t1303-wacky-config.sh
@@ -111,4 +111,24 @@ test_expect_success 'unset many entries' '
test_must_fail git config section.key
'
+test_expect_success '--add appends new value after existing empty value' '
+ cat >expect <<-\EOF &&
+
+
+ fool
+ roll
+ EOF
+ cp .git/config .git/config.old &&
+ test_when_finished "mv .git/config.old .git/config" &&
+ cat >.git/config <<-\EOF &&
+ [foo]
+ baz
+ baz =
+ baz = fool
+ EOF
+ git config --add foo.baz roll &&
+ git config --get-all foo.baz >output &&
+ test_cmp expect output
+'
+
test_done