]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ap/maint-merge-strategy-list-fix' into maint
authorJunio C Hamano <gitster@pobox.com>
Thu, 3 Dec 2009 21:54:11 +0000 (13:54 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 3 Dec 2009 21:54:11 +0000 (13:54 -0800)
* ap/maint-merge-strategy-list-fix:
  builtin-merge.c: call exclude_cmds() correctly.

1  2 
builtin-merge.c

diff --combined builtin-merge.c
index 2871419143d4aa02c46db9dcd794eaa9dba50c23,4bcf7c7bce9fda004fcab7cf569f886bbcb387b4..d3eb5092c8b20b157fe7c2560d293d6a232a37fd
@@@ -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(&not_strategies, ent->name, ent->len);
-                       exclude_cmds(&main_cmds, &not_strategies);
                }
+               exclude_cmds(&main_cmds, &not_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())
                 * 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)