Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-04-18 22:41:28 +0400
committerJunio C Hamano <junkio@cox.net>2006-04-18 22:43:09 +0400
commit3a624b346db02a07b0317743b362d1a15c6c3c18 (patch)
tree14349feaf6ee4a4617cda4cecd0ad4f1eb517b18 /diff.c
parent965f803c323bb72a9dedbbc8f7ba00bbadb6cf58 (diff)
Fix "git log --stat": make sure to set recursive with --stat.
Just like "patch" format always needs recursive, "diffstat" format does not make sense without setting recursive. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/diff.c b/diff.c
index b54bbfa627..d75e0178ff 100644
--- 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) {