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

Function cmd__dump_split_index

t/helper/test-dump-split-index.c:16–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14}
15
16int cmd__dump_split_index(int ac UNUSED, const char **av)
17{
18 struct split_index *si;
19
20 setup_git_directory(the_repository);
21
22 do_read_index(the_repository->index, av[1], 1);
23 printf("own %s\n", oid_to_hex(&the_repository->index->oid));
24 si = the_repository->index->split_index;
25 if (!si) {
26 printf("not a split index\n");
27 return 0;
28 }
29 printf("base %s\n", oid_to_hex(&si->base_oid));
30 for (size_t i = 0; i < the_repository->index->cache_nr; i++) {
31 struct cache_entry *ce = the_repository->index->cache[i];
32 printf("%06o %s %d\t%s\n", ce->ce_mode,
33 oid_to_hex(&ce->oid), ce_stage(ce), ce->name);
34 }
35 printf("replacements:");
36 if (si->replace_bitmap)
37 ewah_each_bit(si->replace_bitmap, show_bit, NULL);
38 printf("\ndeletions:");
39 if (si->delete_bitmap)
40 ewah_each_bit(si->delete_bitmap, show_bit, NULL);
41 printf("\n");
42 return 0;
43}

Callers

nothing calls this directly

Calls 4

setup_git_directoryFunction · 0.85
do_read_indexFunction · 0.85
oid_to_hexFunction · 0.85
ewah_each_bitFunction · 0.85

Tested by

no test coverage detected