summaryrefslogtreecommitdiff
path: root/t/t1300-config.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2018-04-03 16:28:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-04-05 23:30:03 (GMT)
commite9313952bf85bcc8b602f582b2e71660d670f97b (patch)
treed2a645bffdb69f53d4aff1d8513f80106c482c9d /t/t1300-config.sh
parentefbaca1b69b2d08429889259489b73c8eea16a1d (diff)
downloadgit-e9313952bf85bcc8b602f582b2e71660d670f97b.zip
git-e9313952bf85bcc8b602f582b2e71660d670f97b.tar.gz
git-e9313952bf85bcc8b602f582b2e71660d670f97b.tar.bz2
t1300: demonstrate that --replace-all can "invent" newlines
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1300-config.sh')
-rwxr-xr-xt/t1300-config.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/t/t1300-config.sh b/t/t1300-config.sh
index cbeb9be..cef8163 100755
--- a/t/t1300-config.sh
+++ b/t/t1300-config.sh
@@ -1588,4 +1588,25 @@ test_expect_success '--local requires a repo' '
test_expect_code 128 nongit git config --local foo.bar
'
+test_expect_failure '--replace-all does not invent newlines' '
+ q_to_tab >.git/config <<-\EOF &&
+ [abc]key
+ QkeepSection
+ [xyz]
+ Qkey = 1
+ [abc]
+ Qkey = a
+ EOF
+ q_to_tab >expect <<-\EOF &&
+ [abc]
+ QkeepSection
+ [xyz]
+ Qkey = 1
+ [abc]
+ Qkey = b
+ EOF
+ git config --replace-all abc.key b &&
+ test_cmp .git/config expect
+'
+
test_done