diff options
author | Kirill Smelkov <kirr@mns.spb.ru> | 2014-03-27 18:21:29 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-03-27 11:50:29 -0700 |
commit | b9081a657446ac2c5e2129de183edb41d4b4f4fb (patch) | |
tree | 5c18623bcde16212dd57211c15774e3767c93752 /tree-diff.c | |
parent | 52894e70951518e44c064cef2561aed38202fd36 (diff) | |
download | git-b9081a657446ac2c5e2129de183edb41d4b4f4fb.tar.gz |
tree-diff: no need to call "full" diff_tree_sha1 from show_path()
As described in previous commit, when recursing into sub-trees, we can
use lower-level tree walker, since its interface is now sha1 based.
The change is ok, because diff_tree_sha1() only invokes
ll_diff_tree_sha1(), and also, if base is empty, try_to_follow_renames().
But base is not empty here, as we have added a path and '/' before
recursing.
Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'tree-diff.c')
-rw-r--r-- | tree-diff.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tree-diff.c b/tree-diff.c index 55d81469f6..80527c0464 100644 --- a/tree-diff.c +++ b/tree-diff.c @@ -6,6 +6,10 @@ #include "diffcore.h" #include "tree.h" + +static int ll_diff_tree_sha1(const unsigned char *old, const unsigned char *new, + const char *base_str, struct diff_options *opt); + /* * Compare two tree entries, taking into account only path/S_ISDIR(mode), * but not their sha1's. @@ -118,8 +122,8 @@ static void show_path(struct strbuf *base, struct diff_options *opt, if (recurse) { strbuf_addch(base, '/'); - diff_tree_sha1(t1 ? t1->entry.sha1 : NULL, - t2 ? t2->entry.sha1 : NULL, base->buf, opt); + ll_diff_tree_sha1(t1 ? t1->entry.sha1 : NULL, + t2 ? t2->entry.sha1 : NULL, base->buf, opt); } strbuf_setlen(base, old_baselen); |