color: allow "no-" for negating attributes
[gitweb.git] / ll-merge.c
index fb61ea66a13eba3a8e91a05dbe1c37de98cec853..4e789f533043c78916b4281ac8113f1e75d342b4 100644 (file)
@@ -88,7 +88,10 @@ static int ll_xdl_merge(const struct ll_merge_driver *drv_unused,
        xmparam_t xmp;
        assert(opts);
 
-       if (buffer_is_binary(orig->ptr, orig->size) ||
+       if (orig->size > MAX_XDIFF_SIZE ||
+           src1->size > MAX_XDIFF_SIZE ||
+           src2->size > MAX_XDIFF_SIZE ||
+           buffer_is_binary(orig->ptr, orig->size) ||
            buffer_is_binary(src1->ptr, src1->size) ||
            buffer_is_binary(src2->ptr, src2->size)) {
                return ll_binary_merge(drv_unused, result,
@@ -225,11 +228,8 @@ static int read_merge_config(const char *var, const char *value, void *cb)
        const char *key, *name;
        int namelen;
 
-       if (!strcmp(var, "merge.default")) {
-               if (value)
-                       default_ll_merge = xstrdup(value);
-               return 0;
-       }
+       if (!strcmp(var, "merge.default"))
+               return git_config_string(&default_ll_merge, var, value);
 
        /*
         * We are not interested in anything but "merge.<name>.variable";
@@ -254,12 +254,8 @@ static int read_merge_config(const char *var, const char *value, void *cb)
                ll_user_merge_tail = &(fn->next);
        }
 
-       if (!strcmp("name", key)) {
-               if (!value)
-                       return error("%s: lacks value", var);
-               fn->description = xstrdup(value);
-               return 0;
-       }
+       if (!strcmp("name", key))
+               return git_config_string(&fn->description, var, value);
 
        if (!strcmp("driver", key)) {
                if (!value)
@@ -285,12 +281,8 @@ static int read_merge_config(const char *var, const char *value, void *cb)
                return 0;
        }
 
-       if (!strcmp("recursive", key)) {
-               if (!value)
-                       return error("%s: lacks value", var);
-               fn->recursive = xstrdup(value);
-               return 0;
-       }
+       if (!strcmp("recursive", key))
+               return git_config_string(&fn->recursive, var, value);
 
        return 0;
 }