summaryrefslogtreecommitdiff
path: root/t/helper/test-write-cache.c
diff options
context:
space:
mode:
Diffstat (limited to 't/helper/test-write-cache.c')
-rw-r--r--t/helper/test-write-cache.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/t/helper/test-write-cache.c b/t/helper/test-write-cache.c
index 8837717..7e3da38 100644
--- a/t/helper/test-write-cache.c
+++ b/t/helper/test-write-cache.c
@@ -1,6 +1,8 @@
#include "test-tool.h"
-#include "cache.h"
#include "lockfile.h"
+#include "read-cache-ll.h"
+#include "repository.h"
+#include "setup.h"
int cmd__write_cache(int argc, const char **argv)
{
@@ -9,10 +11,11 @@ int cmd__write_cache(int argc, const char **argv)
if (argc == 2)
cnt = strtol(argv[1], NULL, 0);
setup_git_directory();
- read_cache();
+ repo_read_index(the_repository);
for (i = 0; i < cnt; i++) {
- hold_locked_index(&index_lock, LOCK_DIE_ON_ERROR);
- if (write_locked_index(&the_index, &index_lock, COMMIT_LOCK))
+ repo_hold_locked_index(the_repository, &index_lock,
+ LOCK_DIE_ON_ERROR);
+ if (write_locked_index(the_repository->index, &index_lock, COMMIT_LOCK))
die("unable to write index file");
}