MCPcopy Index your code
hub / github.com/git/git / cmd__write_cache

Function cmd__write_cache

t/helper/test-write-cache.c:9–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7#include "setup.h"
8
9int cmd__write_cache(int argc, const char **argv)
10{
11 struct lock_file index_lock = LOCK_INIT;
12 int i, cnt = 1;
13 if (argc == 2)
14 cnt = strtol(argv[1], NULL, 0);
15 setup_git_directory(the_repository);
16 repo_read_index(the_repository);
17 for (i = 0; i < cnt; i++) {
18 repo_hold_locked_index(the_repository, &index_lock,
19 LOCK_DIE_ON_ERROR);
20 if (write_locked_index(the_repository->index, &index_lock, COMMIT_LOCK))
21 die("unable to write index file");
22 }
23
24 return 0;
25}

Callers

nothing calls this directly

Calls 5

setup_git_directoryFunction · 0.85
repo_read_indexFunction · 0.85
repo_hold_locked_indexFunction · 0.85
write_locked_indexFunction · 0.85
dieFunction · 0.50

Tested by

no test coverage detected