Merge branch 'lt/logopt' into next
authorJunio C Hamano <junkio@cox.net>
Tue, 18 Apr 2006 20:18:21 +0000 (13:18 -0700)
committerJunio C Hamano <junkio@cox.net>
Tue, 18 Apr 2006 20:18:21 +0000 (13:18 -0700)
* lt/logopt:
Fix "git log --stat": make sure to set recursive with --stat.

diff.c
revision.c
diff --git a/diff.c b/diff.c
index b54bbfa627219b194333297829843e7200501ee4..d75e0178ff395e2a24b7c42ea6e38faac2c93bbf 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -1029,6 +1029,15 @@ int diff_setup_done(struct diff_options *options)
             options->detect_rename != DIFF_DETECT_COPY) ||
            (0 <= options->rename_limit && !options->detect_rename))
                return -1;
+
+       /*
+        * These cases always need recursive; we do not drop caller-supplied
+        * recursive bits for other formats here.
+        */
+       if ((options->output_format == DIFF_FORMAT_PATCH) ||
+           (options->output_format == DIFF_FORMAT_DIFFSTAT))
+               options->recursive = 1;
+
        if (options->detect_rename && options->rename_limit < 0)
                options->rename_limit = diff_rename_limit_default;
        if (options->setup & DIFF_SETUP_USE_CACHE) {
index 2976497ebf6843e91d954475af3a61e9ba734cb4..dbd54da5baec5b5a2320a40a66da24541705e971 100644 (file)
@@ -791,8 +791,6 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
                if (revs->dense_combined_merges)
                        revs->diffopt.output_format = DIFF_FORMAT_PATCH;
        }
-       if (revs->diffopt.output_format == DIFF_FORMAT_PATCH)
-               revs->diffopt.recursive = 1;
        revs->diffopt.abbrev = revs->abbrev;
        diff_setup_done(&revs->diffopt);