Merge branch 'jc/fetch-sorted' into next
[gitweb.git] / diff.c
diff --git a/diff.c b/diff.c
index be459cac6946fffeba71301416dd9443c1d44eff..7f35e595c93a809d948580308e2bd3e90bb4b262 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -432,7 +432,7 @@ static void checkdiff_consume(void *priv, char *line, unsigned long len)
        else if (line[0] == '@') {
                char *plus = strchr(line, '+');
                if (plus)
-                       data->lineno = strtol(plus, line + len, 10);
+                       data->lineno = strtol(plus, NULL, 10);
                else
                        die("invalid diff");
        }
@@ -1304,6 +1304,14 @@ int diff_setup_done(struct diff_options *options)
            (options->output_format == DIFF_FORMAT_CHECKDIFF))
                options->recursive = 1;
 
+       /*
+        * These combinations do not make sense.
+        */
+       if (options->output_format == DIFF_FORMAT_RAW)
+               options->with_raw = 0;
+       if (options->output_format == DIFF_FORMAT_DIFFSTAT)
+               options->with_stat  = 0;
+
        if (options->detect_rename && options->rename_limit < 0)
                options->rename_limit = diff_rename_limit_default;
        if (options->setup & DIFF_SETUP_USE_CACHE) {