blob: 4728013910cf1a36dac6a594c403c29de60b1fe6 [file] [log] [blame]
Thomas Rast1aed2fe2011-12-06 18:43:35 +01001#include "cache.h"
2#include "tree.h"
3#include "cache-tree.h"
4
5static struct lock_file index_lock;
6
7int main(int ac, char **av)
8{
9 int fd = hold_locked_index(&index_lock, 1);
10 if (read_cache() < 0)
11 die("unable to read index file");
12 active_cache_tree = NULL;
13 if (write_cache(fd, active_cache, active_nr)
14 || commit_lock_file(&index_lock))
15 die("unable to write index file");
16 return 0;
17}