| static unsigned char active_cache_sha1[20]; |
| static struct cache_tree *active_cache_tree; |
| static void dump_cache_tree(struct cache_tree *it, const char *pfx) |
| printf("%-40s %s\n", "invalid", pfx); |
| printf("%s %s (%d entries)\n", |
| for (i = 0; i < it->subtree_nr; i++) { |
| struct cache_tree_sub *down = it->down[i]; |
| sprintf(path, "%s%.*s/", pfx, down->namelen, down->name); |
| dump_cache_tree(down->cache_tree, path); |
| int main(int ac, char **av) |
| if (read_cache_1(active_cache_sha1) < 0) |
| die("unable to read index file"); |
| active_cache_tree = read_cache_tree(active_cache_sha1); |
| dump_cache_tree(active_cache_tree, ""); |