MCPcopy Create free account
hub / github.com/git/git / cmd__scrap_cache_tree

Function cmd__scrap_cache_tree

t/helper/test-scrap-cache-tree.c:11–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include "cache-tree.h"
10
11int cmd__scrap_cache_tree(int ac UNUSED, const char **av UNUSED)
12{
13 struct lock_file index_lock = LOCK_INIT;
14
15 setup_git_directory(the_repository);
16 repo_hold_locked_index(the_repository, &index_lock, LOCK_DIE_ON_ERROR);
17 if (repo_read_index(the_repository) < 0)
18 die("unable to read index file");
19 cache_tree_free(&the_repository->index->cache_tree);
20 the_repository->index->cache_tree = NULL;
21 if (write_locked_index(the_repository->index, &index_lock, COMMIT_LOCK))
22 die("unable to write index file");
23 return 0;
24}

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected