lockfile.h: extract new header file for the functions in lockfile.c
[git/git.git] / test-scrap-cache-tree.c
CommitLineData
1aed2fe3 1#include "cache.h"
697cc8ef 2#include "lockfile.h"
1aed2fe3
TR
3#include "tree.h"
4#include "cache-tree.h"
5
6static struct lock_file index_lock;
7
8int main(int ac, char **av)
9{
03b86647 10 hold_locked_index(&index_lock, 1);
1aed2fe3
TR
11 if (read_cache() < 0)
12 die("unable to read index file");
13 active_cache_tree = NULL;
03b86647 14 if (write_locked_index(&the_index, &index_lock, COMMIT_LOCK))
1aed2fe3
TR
15 die("unable to write index file");
16 return 0;
17}