Merge branch 'jk/diff-graph-submodule-summary'
[gitweb.git] / diff.c
diff --git a/diff.c b/diff.c
index 28a742c24860c502a04ce86416929a627bef2dde..f0b3e7cfe34a99c0e5fea85fcd00ec54e9b578d8 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -1565,7 +1565,7 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)
         * Binary files are displayed with "Bin XXX -> YYY bytes"
         * instead of the change count and graph. This part is treated
         * similarly to the graph part, except that it is not
-        * "scaled". If total width is too small to accomodate the
+        * "scaled". If total width is too small to accommodate the
         * guaranteed minimum width of the filename part and the
         * separators and this message, this message will "overflow"
         * making the line longer than the maximum width.
@@ -3597,8 +3597,8 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
                options->xdl_opts = DIFF_WITH_ALG(options, PATIENCE_DIFF);
        else if (!strcmp(arg, "--histogram"))
                options->xdl_opts = DIFF_WITH_ALG(options, HISTOGRAM_DIFF);
-       else if (!prefixcmp(arg, "--diff-algorithm=")) {
-               long value = parse_algorithm_value(arg+17);
+       else if ((argcount = parse_long_opt("diff-algorithm", av, &optarg))) {
+               long value = parse_algorithm_value(optarg);
                if (value < 0)
                        return error("option diff-algorithm accepts \"myers\", "
                                     "\"minimal\", \"patience\" and \"histogram\"");
@@ -3606,6 +3606,7 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
                DIFF_XDL_CLR(options, NEED_MINIMAL);
                options->xdl_opts &= ~XDF_DIFF_ALGORITHM_MASK;
                options->xdl_opts |= value;
+               return argcount;
        }
 
        /* flags options */