summaryrefslogtreecommitdiff
path: root/tree.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@osdl.org>2005-11-26 17:38:20 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-11-29 07:00:14 (GMT)
commit3c5e8468a93cdb427b4c4a129339e80e1813e5c0 (patch)
treef924da722242e90150ba1b56fb85bc1f2317ed03 /tree.h
parent9ef2b3cbf62d15aa0312bde349347873d7c0f399 (diff)
downloadgit-3c5e8468a93cdb427b4c4a129339e80e1813e5c0.zip
git-3c5e8468a93cdb427b4c4a129339e80e1813e5c0.tar.gz
git-3c5e8468a93cdb427b4c4a129339e80e1813e5c0.tar.bz2
ls-tree: major rewrite to do pathspec
git-ls-tree should be rewritten to use a pathspec the same way everybody else does. Right now it's the odd man out: if you do git-ls-tree HEAD divers/char drivers/ it will show the same files _twice_, which is not how pathspecs in general work. How about this patch? It breaks some of the git-ls-tree tests, but it makes git-ls-tree work a lot more like other git pathspec commands, and it removes more than 150 lines by re-using the recursive tree traversal (but the "-d" flag is gone for good, so I'm not pushing this too hard). Linus
Diffstat (limited to 'tree.h')
-rw-r--r--tree.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/tree.h b/tree.h
index 9975e88..768e5e9 100644
--- a/tree.h
+++ b/tree.h
@@ -35,4 +35,13 @@ int parse_tree(struct tree *tree);
/* Parses and returns the tree in the given ent, chasing tags and commits. */
struct tree *parse_tree_indirect(const unsigned char *sha1);
+#define READ_TREE_RECURSIVE 1
+typedef int (*read_tree_fn_t)(unsigned char *, const char *, int, const char *, unsigned int, int);
+
+extern int read_tree_recursive(void *buffer, unsigned long size,
+ const char *base, int baselen,
+ int stage, const char **match,
+ read_tree_fn_t fn);
+
+
#endif /* TREE_H */