diff options
author | Junio C Hamano <junkio@cox.net> | 2006-04-18 22:29:33 +0400 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-04-18 22:29:33 +0400 |
commit | f56ef54174598d5362d0446c5a560cb5892537c2 (patch) | |
tree | 9eb7864760a784decc4c9821f427e6d4f64cc688 /diff.c | |
parent | 08ddd4f7649ccf8b9f61c903de420bfd0a8a602e (diff) |
diff --stat: make sure to set recursive.
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.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -1029,6 +1029,16 @@ 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->with_stat)) + 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) { |