fmt-merge-msg: package options into a structure

This way new features can be added more easily

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano
2011-11-04 17:35:42 -07:00
parent 4c0ea82da3
commit cbda121c99
3 changed files with 27 additions and 18 deletions

View File

@ -1229,8 +1229,12 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
merge_name(argv[i], &merge_names);
if (!have_message || shortlog_len) {
fmt_merge_msg(&merge_names, &merge_msg, !have_message,
shortlog_len);
struct fmt_merge_msg_opts opts;
memset(&opts, 0, sizeof(opts));
opts.add_title = !have_message;
opts.shortlog_len = shortlog_len;
fmt_merge_msg(&merge_names, &merge_msg, &opts);
if (merge_msg.len)
strbuf_setlen(&merge_msg, merge_msg.len - 1);
}