5 int cmd__write_cache(int argc, const char **argv)
 
   7         struct lock_file index_lock = LOCK_INIT;
 
  10                 cnt = strtol(argv[1], NULL, 0);
 
  11         setup_git_directory();
 
  13         for (i = 0; i < cnt; i++) {
 
  14                 hold_locked_index(&index_lock, LOCK_DIE_ON_ERROR);
 
  15                 if (write_locked_index(&the_index, &index_lock, COMMIT_LOCK))
 
  16                         die("unable to write index file");