Skip to content

Commit e931395

Browse files
dschogitster
authored andcommitted
t1300: demonstrate that --replace-all can "invent" newlines
Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent efbaca1 commit e931395

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

t/t1300-config.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,4 +1588,25 @@ test_expect_success '--local requires a repo' '
15881588
test_expect_code 128 nongit git config --local foo.bar
15891589
'
15901590

1591+
test_expect_failure '--replace-all does not invent newlines' '
1592+
q_to_tab >.git/config <<-\EOF &&
1593+
[abc]key
1594+
QkeepSection
1595+
[xyz]
1596+
Qkey = 1
1597+
[abc]
1598+
Qkey = a
1599+
EOF
1600+
q_to_tab >expect <<-\EOF &&
1601+
[abc]
1602+
QkeepSection
1603+
[xyz]
1604+
Qkey = 1
1605+
[abc]
1606+
Qkey = b
1607+
EOF
1608+
git config --replace-all abc.key b &&
1609+
test_cmp .git/config expect
1610+
'
1611+
15911612
test_done

0 commit comments

Comments
 (0)