Signed-off-by: Johannes Schindelin <johannes.schindelin@xxxxxx> --- t/t1300-config.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/t/t1300-config.sh b/t/t1300-config.sh index 4f8e6f5fde3..cc417687e8d 100755 --- a/t/t1300-config.sh +++ b/t/t1300-config.sh @@ -1611,4 +1611,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 -- 2.17.0.windows.1.4.g7e4058d72e3