fmt-merge-msg: be quiet if nothing to merge

When FETCH_HEAD contains only 'not-for-merge' entries fmt-merge-msg
still outputs "Merge" (and if the branch isn't master " into <branch>").
In this case fmt-merge-msg is outputting junk and should really just
be quiet. Fix it.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Stephen Boyd
2010-03-24 00:15:58 -07:00
committed by Junio C Hamano
parent 5e4f614742
commit 419fe5bc86
2 changed files with 22 additions and 0 deletions

View File

@ -281,6 +281,9 @@ int fmt_merge_msg(int merge_summary, struct strbuf *in, struct strbuf *out) {
die ("Error in line %d: %.*s", i, len, p);
}
if (!srcs.nr)
return 0;
strbuf_addstr(out, "Merge ");
for (i = 0; i < srcs.nr; i++) {
struct src_data *src_data = srcs.payload[i];