зеркало из https://github.com/microsoft/git.git
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>
This commit is contained in:
Родитель
08ddd4f764
Коммит
f56ef54174
|
@ -117,9 +117,6 @@ int main(int argc, const char **argv)
|
||||||
if (opt->dense_combined_merges)
|
if (opt->dense_combined_merges)
|
||||||
opt->diffopt.output_format = DIFF_FORMAT_PATCH;
|
opt->diffopt.output_format = DIFF_FORMAT_PATCH;
|
||||||
|
|
||||||
if (opt->diffopt.output_format == DIFF_FORMAT_PATCH)
|
|
||||||
opt->diffopt.recursive = 1;
|
|
||||||
|
|
||||||
diff_tree_setup_paths(get_pathspec(prefix, argv), &opt->diffopt);
|
diff_tree_setup_paths(get_pathspec(prefix, argv), &opt->diffopt);
|
||||||
diff_setup_done(&opt->diffopt);
|
diff_setup_done(&opt->diffopt);
|
||||||
|
|
||||||
|
|
10
diff.c
10
diff.c
|
@ -1029,6 +1029,16 @@ int diff_setup_done(struct diff_options *options)
|
||||||
options->detect_rename != DIFF_DETECT_COPY) ||
|
options->detect_rename != DIFF_DETECT_COPY) ||
|
||||||
(0 <= options->rename_limit && !options->detect_rename))
|
(0 <= options->rename_limit && !options->detect_rename))
|
||||||
return -1;
|
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)
|
if (options->detect_rename && options->rename_limit < 0)
|
||||||
options->rename_limit = diff_rename_limit_default;
|
options->rename_limit = diff_rename_limit_default;
|
||||||
if (options->setup & DIFF_SETUP_USE_CACHE) {
|
if (options->setup & DIFF_SETUP_USE_CACHE) {
|
||||||
|
|
2
git.c
2
git.c
|
@ -344,8 +344,6 @@ static int cmd_log(int argc, const char **argv, char **envp)
|
||||||
opt.ignore_merges = 0;
|
opt.ignore_merges = 0;
|
||||||
if (opt.dense_combined_merges)
|
if (opt.dense_combined_merges)
|
||||||
opt.diffopt.output_format = DIFF_FORMAT_PATCH;
|
opt.diffopt.output_format = DIFF_FORMAT_PATCH;
|
||||||
if (opt.diffopt.output_format == DIFF_FORMAT_PATCH)
|
|
||||||
opt.diffopt.recursive = 1;
|
|
||||||
if (!full_diff && rev.prune_data)
|
if (!full_diff && rev.prune_data)
|
||||||
diff_tree_setup_paths(rev.prune_data, &opt.diffopt);
|
diff_tree_setup_paths(rev.prune_data, &opt.diffopt);
|
||||||
diff_setup_done(&opt.diffopt);
|
diff_setup_done(&opt.diffopt);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче