]>
Commit | Line | Data |
---|---|---|
ff5fb8b0 | 1 | #include "test-tool.h" |
1aed2fe3 | 2 | #include "cache.h" |
697cc8ef | 3 | #include "lockfile.h" |
1aed2fe3 TR |
4 | #include "tree.h" |
5 | #include "cache-tree.h" | |
6 | ||
ff5fb8b0 | 7 | int cmd__scrap_cache_tree(int ac, const char **av) |
1aed2fe3 | 8 | { |
0fa5a2ed MÅ |
9 | struct lock_file index_lock = LOCK_INIT; |
10 | ||
4ce742fc | 11 | setup_git_directory(); |
b3e83cc7 | 12 | hold_locked_index(&index_lock, LOCK_DIE_ON_ERROR); |
1aed2fe3 TR |
13 | if (read_cache() < 0) |
14 | die("unable to read index file"); | |
9afa46d4 | 15 | cache_tree_free(&active_cache_tree); |
1aed2fe3 | 16 | active_cache_tree = NULL; |
03b86647 | 17 | if (write_locked_index(&the_index, &index_lock, COMMIT_LOCK)) |
1aed2fe3 TR |
18 | die("unable to write index file"); |
19 | return 0; | |
20 | } |