setup.h: move declarations for setup.c functions from cache.h
[git.git] / t / helper / test-scrap-cache-tree.c
blob15b7688774c25add02b81acd5fbe38abc1287379
1 #define USE_THE_INDEX_VARIABLE
2 #include "test-tool.h"
3 #include "cache.h"
4 #include "lockfile.h"
5 #include "setup.h"
6 #include "tree.h"
7 #include "cache-tree.h"
9 int cmd__scrap_cache_tree(int ac, const char **av)
11 struct lock_file index_lock = LOCK_INIT;
13 setup_git_directory();
14 repo_hold_locked_index(the_repository, &index_lock, LOCK_DIE_ON_ERROR);
15 if (repo_read_index(the_repository) < 0)
16 die("unable to read index file");
17 cache_tree_free(&the_index.cache_tree);
18 the_index.cache_tree = NULL;
19 if (write_locked_index(&the_index, &index_lock, COMMIT_LOCK))
20 die("unable to write index file");
21 return 0;