diff options
Diffstat (limited to 't/helper/test-dump-cache-tree.c')
-rw-r--r-- | t/helper/test-dump-cache-tree.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/t/helper/test-dump-cache-tree.c b/t/helper/test-dump-cache-tree.c index 0d6d7f1ecb..f22f7bd84a 100644 --- a/t/helper/test-dump-cache-tree.c +++ b/t/helper/test-dump-cache-tree.c @@ -1,8 +1,12 @@ +#define USE_THE_INDEX_VARIABLE #include "test-tool.h" #include "cache.h" +#include "hash.h" +#include "hex.h" #include "tree.h" #include "cache-tree.h" - +#include "repository.h" +#include "setup.h" static void dump_one(struct cache_tree *it, const char *pfx, const char *x) { @@ -55,19 +59,19 @@ static int dump_cache_tree(struct cache_tree *it, return errs; } -int cmd__dump_cache_tree(int ac, const char **av) +int cmd__dump_cache_tree(int ac UNUSED, const char **av UNUSED) { struct index_state istate; struct cache_tree *another = cache_tree(); int ret; setup_git_directory(); - if (read_cache() < 0) + if (repo_read_index(the_repository) < 0) die("unable to read index file"); istate = the_index; istate.cache_tree = another; cache_tree_update(&istate, WRITE_TREE_DRY_RUN); - ret = dump_cache_tree(active_cache_tree, another, ""); + ret = dump_cache_tree(the_index.cache_tree, another, ""); cache_tree_free(&another); return ret; |