From: Junio C Hamano Date: Thu, 3 Dec 2009 21:54:11 +0000 (-0800) Subject: Merge branch 'ap/maint-merge-strategy-list-fix' into maint X-Git-Tag: v1.6.5.5~9 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/99292c638a5c011ce453c904357185d9f6c7dd62?hp=-c Merge branch 'ap/maint-merge-strategy-list-fix' into maint * ap/maint-merge-strategy-list-fix: builtin-merge.c: call exclude_cmds() correctly. --- 99292c638a5c011ce453c904357185d9f6c7dd62 diff --combined builtin-merge.c index 2871419143,4bcf7c7bce..d3eb5092c8 --- a/builtin-merge.c +++ b/builtin-merge.c @@@ -70,7 -70,7 +70,7 @@@ static int option_parse_message(const s if (unset) strbuf_setlen(buf, 0); else if (arg) { - strbuf_addf(buf, "%s\n\n", arg); + strbuf_addf(buf, "%s%s", buf->len ? "\n\n" : "", arg); have_message = 1; } else return error("switch `m' requires a value"); @@@ -106,8 -106,8 +106,8 @@@ static struct strategy *get_strategy(co found = 1; if (!found) add_cmdname(¬_strategies, ent->name, ent->len); - exclude_cmds(&main_cmds, ¬_strategies); } + exclude_cmds(&main_cmds, ¬_strategies); } if (!is_in_cmdlist(&main_cmds, name) && !is_in_cmdlist(&other_cmds, name)) { fprintf(stderr, "Could not find merge strategy '%s'.\n", name); @@@ -792,7 -792,7 +792,7 @@@ static int suggest_conflicts(void static struct commit *is_old_style_invocation(int argc, const char **argv) { struct commit *second_token = NULL; - if (argc > 1) { + if (argc > 2) { unsigned char second_sha1[20]; if (get_sha1(argv[1], second_sha1)) @@@ -840,6 -840,7 +840,6 @@@ int cmd_merge(int argc, const char **ar const char *best_strategy = NULL, *wt_strategy = NULL; struct commit_list **remotes = &remoteheads; - setup_work_tree(); if (file_exists(git_path("MERGE_HEAD"))) die("You have not concluded your merge. (MERGE_HEAD exists)"); if (read_cache_unmerged()) @@@ -927,13 -928,11 +927,13 @@@ * codepath so we discard the error in this * loop. */ - for (i = 0; i < argc; i++) - merge_name(argv[i], &msg); - fmt_merge_msg(option_log, &msg, &merge_msg); - if (merge_msg.len) - strbuf_setlen(&merge_msg, merge_msg.len-1); + if (!have_message) { + for (i = 0; i < argc; i++) + merge_name(argv[i], &msg); + fmt_merge_msg(option_log, &msg, &merge_msg); + if (merge_msg.len) + strbuf_setlen(&merge_msg, merge_msg.len-1); + } } if (head_invalid || !argc)