diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-02-05 14:26:17 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-02-05 14:26:17 -0800 |
commit | 5d2710bd3c706c3375991972b630f9419551f24e (patch) | |
tree | 8f50b388a223e1f63c8624fc9d4dfbc23f0b069d /combine-diff.c | |
parent | 5ad3550f026d7ea1b96e699fdf072b642e8a4b8b (diff) | |
parent | dac03b5518a053e52ed7ee20925970728d3ae4c3 (diff) | |
download | git-5d2710bd3c706c3375991972b630f9419551f24e.tar.gz |
Merge branch 'jk/diff-cc-stat-fixes'
"git diff --color-moved --cc --stat -p" did not work well due to
funny interaction between a bug in color-moved and the rest, which
has been fixed.
* jk/diff-cc-stat-fixes:
combine-diff: treat --dirstat like --stat
combine-diff: treat --summary like --stat
combine-diff: treat --shortstat like --stat
combine-diff: factor out stat-format mask
diff: clear emitted_symbols flag after use
t4006: resurrect commented-out tests
Diffstat (limited to 'combine-diff.c')
-rw-r--r-- | combine-diff.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/combine-diff.c b/combine-diff.c index a143c00634..23d8fabe75 100644 --- a/combine-diff.c +++ b/combine-diff.c @@ -1321,6 +1321,14 @@ static const char *path_path(void *obj) return path->path; } +/* + * Diff stat formats which we always compute solely against the first parent. + */ +#define STAT_FORMAT_MASK (DIFF_FORMAT_NUMSTAT \ + | DIFF_FORMAT_SHORTSTAT \ + | DIFF_FORMAT_SUMMARY \ + | DIFF_FORMAT_DIRSTAT \ + | DIFF_FORMAT_DIFFSTAT) /* find set of paths that every parent touches */ static struct combine_diff_path *find_paths_generic(const struct object_id *oid, @@ -1342,8 +1350,7 @@ static struct combine_diff_path *find_paths_generic(const struct object_id *oid, * show stat against the first parent even when doing * combined diff. */ - int stat_opt = (output_format & - (DIFF_FORMAT_NUMSTAT|DIFF_FORMAT_DIFFSTAT)); + int stat_opt = output_format & STAT_FORMAT_MASK; if (i == 0 && stat_opt) opt->output_format = stat_opt; else @@ -1470,8 +1477,7 @@ void diff_tree_combined(const struct object_id *oid, * show stat against the first parent even * when doing combined diff. */ - stat_opt = (opt->output_format & - (DIFF_FORMAT_NUMSTAT|DIFF_FORMAT_DIFFSTAT)); + stat_opt = opt->output_format & STAT_FORMAT_MASK; if (stat_opt) { diffopts.output_format = stat_opt; @@ -1515,8 +1521,7 @@ void diff_tree_combined(const struct object_id *oid, show_raw_diff(p, num_parent, rev); needsep = 1; } - else if (opt->output_format & - (DIFF_FORMAT_NUMSTAT|DIFF_FORMAT_DIFFSTAT)) + else if (opt->output_format & STAT_FORMAT_MASK) needsep = 1; else if (opt->output_format & DIFF_FORMAT_CALLBACK) handle_combined_callback(opt, paths, num_parent, num_paths); |