Browse Source

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>
maint
Junio C Hamano 19 years ago
parent
commit
3a624b346d
  1. 9
      diff.c
  2. 2
      revision.c

9
diff.c

@ -1029,6 +1029,15 @@ int diff_setup_done(struct diff_options *options) @@ -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) {

2
revision.c

@ -791,8 +791,6 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch @@ -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);


Loading…
Cancel
Save