]>
git.ipfire.org Git - thirdparty/git.git/blob - t/helper/test-scrap-cache-tree.c
1 #define USE_THE_INDEX_VARIABLE
5 #include "repository.h"
8 #include "cache-tree.h"
10 int cmd__scrap_cache_tree(int ac UNUSED
, const char **av UNUSED
)
12 struct lock_file index_lock
= LOCK_INIT
;
14 setup_git_directory();
15 repo_hold_locked_index(the_repository
, &index_lock
, LOCK_DIE_ON_ERROR
);
16 if (repo_read_index(the_repository
) < 0)
17 die("unable to read index file");
18 cache_tree_free(&the_index
.cache_tree
);
19 the_index
.cache_tree
= NULL
;
20 if (write_locked_index(&the_index
, &index_lock
, COMMIT_LOCK
))
21 die("unable to write index file");