1#include "cache.h"
2#include "lockfile.h"
34
int cmd_main(int argc, const char **argv)
5{
6struct lock_file index_lock = LOCK_INIT;
7int i, cnt = 1;
8if (argc == 2)
9cnt = strtol(argv[1], NULL, 0);
10setup_git_directory();
11read_cache();
12for (i = 0; i < cnt; i++) {
13hold_locked_index(&index_lock, LOCK_DIE_ON_ERROR);
14if (write_locked_index(&the_index, &index_lock, COMMIT_LOCK))
15die("unable to write index file");
16}
1718
return 0;
19}