5 static struct lock_file index_lock;
7 int cmd__write_cache(int argc, const char **argv)
9 int i, cnt = 1, lockfd;
11 cnt = strtol(argv[1], NULL, 0);
12 setup_git_directory();
14 for (i = 0; i < cnt; i++) {
15 lockfd = hold_locked_index(&index_lock, LOCK_DIE_ON_ERROR);
17 write_locked_index(&the_index, &index_lock, COMMIT_LOCK);
19 rollback_lock_file(&index_lock);