Code

Merge branch 'jc/better-conflict-resolution'
[git.git] / xdiff-interface.c
index 944ad9887f5c94ca0e63f9a6c901447634f871ce..8457601bc417129803c298df57d5d12c6e317096 100644 (file)
@@ -249,3 +249,23 @@ void xdiff_set_find_func(xdemitconf_t *xecfg, const char *value)
                value = ep + 1;
        }
 }
+
+int git_xmerge_style = -1;
+
+int git_xmerge_config(const char *var, const char *value, void *cb)
+{
+       if (!strcasecmp(var, "merge.conflictstyle")) {
+               if (!value)
+                       die("'%s' is not a boolean", var);
+               if (!strcmp(value, "diff3"))
+                       git_xmerge_style = XDL_MERGE_DIFF3;
+               else if (!strcmp(value, "merge"))
+                       git_xmerge_style = 0;
+               else
+                       die("unknown style '%s' given for '%s'",
+                           value, var);
+               return 0;
+       }
+       return git_default_config(var, value, cb);
+}
+