]>
git.ipfire.org Git - thirdparty/git.git/blob - t/helper/test-write-cache.c
1 #define USE_THE_INDEX_VARIABLE
5 #include "read-cache-ll.h"
6 #include "repository.h"
9 int cmd__write_cache(int argc
, const char **argv
)
11 struct lock_file index_lock
= LOCK_INIT
;
14 cnt
= strtol(argv
[1], NULL
, 0);
15 setup_git_directory();
16 repo_read_index(the_repository
);
17 for (i
= 0; i
< cnt
; i
++) {
18 repo_hold_locked_index(the_repository
, &index_lock
,
20 if (write_locked_index(&the_index
, &index_lock
, COMMIT_LOCK
))
21 die("unable to write index file");