diff options
author | Kirill Smelkov <kirr@mns.spb.ru> | 2014-02-24 20:21:38 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-03-20 15:03:24 -0700 |
commit | d00e980c224d4b65972dda4474fbd9294bdb185f (patch) | |
tree | 64ebd699c0a5ef9c8db13d141ffbed549e78e1ee /tree.h | |
parent | 7e9003c1497d01f2e75a5f3df7303643fb2432c3 (diff) | |
download | git-d00e980c224d4b65972dda4474fbd9294bdb185f.tar.gz |
tree-diff: consolidate code for emitting diffs and recursion in one place
Currently both compare_tree_entry() and show_entry() invoke opt diff
callbacks (opt->add_remove() and opt->change()), and also they both have
code which decides whether to recurse into sub-tree, and whether to emit
a tree as separate entry if DIFF_OPT_TREE_IN_RECURSIVE is set.
I.e. we have code duplication and logic scattered on two places.
Let's consolidate it - all diff emiting code and recurion logic moves
to show_entry, which is now named as show_path, because it shows diff
for a path, based on up to two tree entries, with actual diff emitting
code being kept in new helper emit_diff() for clarity.
What we have as the result, is that compare_tree_entry is now free from
code with logic for diff generation, and also performance is not
affected as timings for
`git log --raw --no-abbrev --no-renames`
for navy.git and `linux.git v3.10..v3.11`, just like in previous patch,
stay the same.
Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'tree.h')
0 files changed, 0 insertions, 0 deletions