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>
Kirill Smelkov committed
Mar 27, 2014 at 18:21 UTC
b9081a657446ac2c5e2129de183edb41d4b4f4fb
1 file changed
+6
-2
tree-diff.c
+6
-2
@@ -6,6 +6,10 @@
6
#include "diffcore.h"
7
#include "tree.h"
8
9
+
10
+static int ll_diff_tree_sha1(const unsigned char *old, const unsigned char *new,
11
+ const char *base_str, struct diff_options *opt);
12
+
13
/*
14
* Compare two tree entries, taking into account only path/S_ISDIR(mode),
15
* but not their sha1's.
@@ -118,8 +122,8 @@ static void show_path(struct strbuf *base, struct diff_options *opt,
122
123
if (recurse) {
124
strbuf_addch(base, '/');
121
- diff_tree_sha1(t1 ? t1->entry.sha1 : NULL,
122
- t2 ? t2->entry.sha1 : NULL, base->buf, opt);
125
+ ll_diff_tree_sha1(t1 ? t1->entry.sha1 : NULL,
126
+ t2 ? t2->entry.sha1 : NULL, base->buf, opt);
127
}
128
129
strbuf_setlen(base, old_baselen);