3 #include "read-cache-ll.h"
4 #include "repository.h"
7 #include "cache-tree.h"
9 int cmd__scrap_cache_tree(int ac UNUSED
, const char **av UNUSED
)
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_repository
->index
->cache_tree
);
18 the_repository
->index
->cache_tree
= NULL
;
19 if (write_locked_index(the_repository
->index
, &index_lock
, COMMIT_LOCK
))
20 die("unable to write index file");