Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Turner <dturner@twopensource.com>2015-12-22 01:34:20 +0300
committerJunio C Hamano <gitster@pobox.com>2016-01-06 00:39:46 +0300
commitd9c2bd560e1e7a3d4654fb6ef3f9037ad337eb01 (patch)
tree04df29e0820e079bf4c90570b6e1adf39af5a1ac /tree-walk.h
parentf3adf457e046f92f039353762a78dcb3afb2cb13 (diff)
do_compare_entry: use already-computed path
In traverse_trees, we generate the complete traverse path for a traverse_info. Later, in do_compare_entry, we used to go do a bunch of work to compare the traverse_info to a cache_entry's name without computing that path. But since we already have that path, we don't need to do all that work. Instead, we can just put the generated path into the traverse_info, and do the comparison more directly. We copy the path because prune_traversal might mutate `base`. This doesn't happen in any codepaths where do_compare_entry is called, but it's better to be safe. This makes git checkout much faster -- about 25% on Twitter's monorepo. Deeper directory trees are likely to benefit more than shallower ones. Signed-off-by: David Turner <dturner@twopensource.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'tree-walk.h')
-rw-r--r--tree-walk.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tree-walk.h b/tree-walk.h
index 3b2f7bf17d..174eb617df 100644
--- a/tree-walk.h
+++ b/tree-walk.h
@@ -59,6 +59,7 @@ enum follow_symlinks_result {
enum follow_symlinks_result get_tree_entry_follow_symlinks(unsigned char *tree_sha1, const char *name, unsigned char *result, struct strbuf *result_path, unsigned *mode);
struct traverse_info {
+ const char *traverse_path;
struct traverse_info *prev;
struct name_entry name;
int pathlen;