summaryrefslogtreecommitdiffstats
path: root/builtin/fmt-merge-msg.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-12-22 21:28:22 +0100
committerJunio C Hamano <gitster@pobox.com>2014-12-22 21:28:22 +0100
commita305b15f82984bd000351e5ab4720a4a170e42b0 (patch)
tree57610b81424bc4aecbfd7a6da78c1d1ca7a0167f /builtin/fmt-merge-msg.c
parentMerge branch 'jg/prompt-localize-temporary' (diff)
parentuse strbuf_complete_line() for adding a newline if needed (diff)
downloadgit-a305b15f82984bd000351e5ab4720a4a170e42b0.tar.xz
git-a305b15f82984bd000351e5ab4720a4a170e42b0.zip
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);
}