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.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/t/helper/test-write-cache.c b/t/helper/test-write-cache.c
index 8837717d36..eace08072d 100644
--- a/t/helper/test-write-cache.c
+++ b/t/helper/test-write-cache.c
@@ -1,6 +1,9 @@
+#define USE_THE_INDEX_VARIABLE
#include "test-tool.h"
#include "cache.h"
#include "lockfile.h"
+#include "repository.h"
+#include "setup.h"
int cmd__write_cache(int argc, const char **argv)
{
@@ -9,9 +12,10 @@ 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);
+ repo_hold_locked_index(the_repository, &index_lock,
+ LOCK_DIE_ON_ERROR);
if (write_locked_index(&the_index, &index_lock, COMMIT_LOCK))
die("unable to write index file");
}