git-merge documentation: describe how conflict is presented
[gitweb.git] / builtin-checkout.c
index b957193155f799ebea0cabcc7496408d4d96d599..79214327b0d99369b3ce384ed1900342f5874c87 100644 (file)
@@ -580,6 +580,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
        const char *arg;
        struct branch_info new;
        struct tree *source_tree = NULL;
+       char *conflict_style = NULL;
        struct option options[] = {
                OPT__QUIET(&opts.quiet),
                OPT_STRING('b', NULL, &opts.new_branch, "new branch", "branch"),
@@ -591,7 +592,9 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
                OPT_SET_INT('3', "theirs", &opts.writeout_stage, "stage",
                            3),
                OPT_BOOLEAN('f', NULL, &opts.force, "force"),
-               OPT_BOOLEAN('m', NULL, &opts.merge, "merge"),
+               OPT_BOOLEAN('m', "merge", &opts.merge, "merge"),
+               OPT_STRING(0, "conflict", &conflict_style, "style",
+                          "conflict style (merge or diff3)"),
                OPT_END(),
        };
        int has_dash_dash;
@@ -606,6 +609,11 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
        argc = parse_options(argc, argv, options, checkout_usage,
                             PARSE_OPT_KEEP_DASHDASH);
 
+       if (conflict_style) {
+               opts.merge = 1; /* implied */
+               git_xmerge_config("merge.conflictstyle", conflict_style, NULL);
+       }
+
        if (!opts.new_branch && (opts.track != git_branch_track))
                die("git checkout: --track and --no-track require -b");