diff options
author | Linus Torvalds <torvalds@osdl.org> | 2005-11-26 09:38:20 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-11-28 23:00:14 -0800 |
commit | 3c5e8468a93cdb427b4c4a129339e80e1813e5c0 (patch) | |
tree | f924da722242e90150ba1b56fb85bc1f2317ed03 /tree.h | |
parent | 9ef2b3cbf62d15aa0312bde349347873d7c0f399 (diff) | |
download | git-3c5e8468a93cdb427b4c4a129339e80e1813e5c0.tar.gz git-3c5e8468a93cdb427b4c4a129339e80e1813e5c0.tar.xz |
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.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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 */ |