aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config.c1
-rwxr-xr-xt/t1300-config.sh2
2 files changed, 2 insertions, 1 deletions
diff --git a/config.c b/config.c
index 4c8571ab33..c55d6a564e 100644
--- a/config.c
+++ b/config.c
@@ -2617,6 +2617,7 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,
store.seen = 1;
for (i = 0, copy_begin = 0; i < store.seen; i++) {
+ new_line = 0;
if (store.offset[i] == 0) {
store.offset[i] = copy_end = contents_sz;
} else if (store.state != KEY_SEEN) {
diff --git a/t/t1300-config.sh b/t/t1300-config.sh
index cef816325b..8f37ffadb1 100755
--- a/t/t1300-config.sh
+++ b/t/t1300-config.sh
@@ -1588,7 +1588,7 @@ 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' '
+test_expect_success '--replace-all does not invent newlines' '
q_to_tab >.git/config <<-\EOF &&
[abc]key
QkeepSection