path: root/tree-walk.h
diff options
authorLinus Torvalds <>2008-03-06 04:06:18 (GMT)
committerJunio C Hamano <>2008-03-09 08:43:47 (GMT)
commit91e4f03604bd089e09154e95294d5d08c805ea49 (patch)
tree4e558499cc4f26afc480983d28e9a1401fac818e /tree-walk.h
parent5803c6f8a2faf8cfbbd046d9ebd682b82bb2b086 (diff)
Make 'traverse_trees()' traverse conflicting DF entries in parallel
This makes the traverse_trees() entry comparator routine use the more relaxed form of name comparison that considers files and directories with the same name identical. We pass in a separate mask for just the directory entries, so that the callback routine can decide (if it wants to) to only handle one or the other type, but generally most (all?) users are expected to really want to see the case of a name 'foo' showing up in one tree as a file and in another as a directory at the same time. In particular, moving 'unpack_trees()' over to use this tree traversal mechanism requires this. Signed-off-by: Linus Torvalds <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'tree-walk.h')
1 files changed, 2 insertions, 1 deletions
diff --git a/tree-walk.h b/tree-walk.h
index c123cfe..42110a4 100644
--- a/tree-walk.h
+++ b/tree-walk.h
@@ -34,7 +34,7 @@ int tree_entry(struct tree_desc *, struct name_entry *);
void *fill_tree_descriptor(struct tree_desc *desc, const unsigned char *sha1);
struct traverse_info;
-typedef int (*traverse_callback_t)(int n, unsigned long mask, struct name_entry *entry, struct traverse_info *);
+typedef int (*traverse_callback_t)(int n, unsigned long mask, unsigned long dirmask, struct name_entry *entry, struct traverse_info *);
int traverse_trees(int n, struct tree_desc *t, struct traverse_info *info);
struct traverse_info {
@@ -42,6 +42,7 @@ struct traverse_info {
struct name_entry name;
int pathlen;
+ unsigned long conflicts;
traverse_callback_t fn;
void *data;