Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/helper/test-scrap-cache-tree.c # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / helper / test-scrap-cache-tree.c` 24 lines ยท 715 bytes Raw Blame History 1 #define USE_THE_REPOSITORY_VARIABLE 2 3 #include "test-tool.h" 4 #include "lockfile.h" 5 #include "read-cache-ll.h" 6 #include "repository.h" 7 #include "setup.h" 8 #include "tree.h" 9 #include "cache-tree.h" 10 11 int 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 }