summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2842c0f)
raw | patch | inline | side by side (parent: 2842c0f)
author | Junio C Hamano <gitster@pobox.com> | |
Mon, 29 Aug 2011 19:31:06 +0000 (12:31 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 29 Aug 2011 22:08:31 +0000 (15:08 -0700) |
Use the pathspec pruning of traverse_trees() from unpack_trees(). Again,
the unpack_trees() machinery is primarily meant for merging two (or more)
trees, and because a merge is a full tree operation, it didn't support any
pruning with pathspec, and this codepath probably should not be enabled
while running a merge, but the caller in diff-lib.c::diff_cache() should
be able to take advantage of it.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
the unpack_trees() machinery is primarily meant for merging two (or more)
trees, and because a merge is a full tree operation, it didn't support any
pruning with pathspec, and this codepath probably should not be enabled
while running a merge, but the caller in diff-lib.c::diff_cache() should
be able to take advantage of it.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
unpack-trees.c | patch | blob | history | |
unpack-trees.h | patch | blob | history |
diff --git a/unpack-trees.c b/unpack-trees.c
index 07f83642443601d107e0a2425407b3250c022dcd..d5ec463e0ef40a2b1276c1e73f0c3e9d908002d4 100644 (file)
--- a/unpack-trees.c
+++ b/unpack-trees.c
newinfo = *info;
newinfo.prev = info;
+ newinfo.pathspec = info->pathspec;
newinfo.name = *p;
newinfo.pathlen += tree_entry_len(p->path, p->sha1) + 1;
newinfo.conflicts |= df_conflicts;
@@ -1040,6 +1041,7 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
info.fn = unpack_callback;
info.data = o;
info.show_all_errors = o->show_all_errors;
+ info.pathspec = o->pathspec;
if (o->prefix) {
/*
diff --git a/unpack-trees.h b/unpack-trees.h
index 64f02cb03ab242ac08ea0f1afbb24e71cf6664aa..b7fed7e6ecafb5c21bf8d6f4cffaa2847cfb54d8 100644 (file)
--- a/unpack-trees.h
+++ b/unpack-trees.h
const char *prefix;
int cache_bottom;
struct dir_struct *dir;
+ struct pathspec *pathspec;
merge_fn_t fn;
const char *msgs[NB_UNPACK_TREES_ERROR_TYPES];
/*