3 #include "cache-tree.h"
5 static void dump_cache_tree(struct cache_tree *it, const char *pfx)
10 if (it->entry_count < 0)
11 printf("%-40s %s (%d subtrees)\n", "invalid", pfx,
14 printf("%s %s (%d entries, %d subtrees)\n",
15 sha1_to_hex(it->sha1),
16 pfx, it->entry_count, it->subtree_nr);
17 for (i = 0; i < it->subtree_nr; i++) {
19 struct cache_tree_sub *down = it->down[i];
20 sprintf(path, "%s%.*s/", pfx, down->namelen, down->name);
21 dump_cache_tree(down->cache_tree, path);
25 int main(int ac, char **av)
28 die("unable to read index file");
29 dump_cache_tree(active_cache_tree, "");