summaryrefslogtreecommitdiff
path: root/hash.h
diff options
context:
space:
mode:
authorKirill Smelkov <kirr@mns.spb.ru>2014-02-24 20:21:38 +0400
committerJunio C Hamano <gitster@pobox.com>2014-03-20 15:03:24 -0700
commitd00e980c224d4b65972dda4474fbd9294bdb185f (patch)
tree64ebd699c0a5ef9c8db13d141ffbed549e78e1ee /hash.h
parent7e9003c1497d01f2e75a5f3df7303643fb2432c3 (diff)
downloadgit-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 'hash.h')
0 files changed, 0 insertions, 0 deletions