summaryrefslogtreecommitdiff
path: root/builtin/fmt-merge-msg.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-12-22 12:28:22 -0800
committerJunio C Hamano <gitster@pobox.com>2014-12-22 12:28:22 -0800
commita305b15f82984bd000351e5ab4720a4a170e42b0 (patch)
tree57610b81424bc4aecbfd7a6da78c1d1ca7a0167f /builtin/fmt-merge-msg.c
parent35b5a8b76999e3c48c3e01c3fd8559bd447d2dfa (diff)
parenta0d4923ddfb65c91d2b84ca74eee09424f986a8b (diff)
downloadgit-a305b15f82984bd000351e5ab4720a4a170e42b0.tar.gz
Merge branch 'rs/use-strbuf-complete-line'
* rs/use-strbuf-complete-line: use strbuf_complete_line() for adding a newline if needed
Diffstat (limited to 'builtin/fmt-merge-msg.c')
-rw-r--r--builtin/fmt-merge-msg.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c
index 37177c6c29..af7919e51e 100644
--- a/builtin/fmt-merge-msg.c
+++ b/builtin/fmt-merge-msg.c
@@ -216,8 +216,7 @@ static void add_branch_desc(struct strbuf *out, const char *name)
strbuf_addf(out, " : %.*s", (int)(ep - bp), bp);
bp = ep;
}
- if (out->buf[out->len - 1] != '\n')
- strbuf_addch(out, '\n');
+ strbuf_complete_line(out);
}
strbuf_release(&desc);
}