]> git.ipfire.org Git - thirdparty/git.git/blame - t/helper/test-dump-split-index.c
sha1-file: split OBJECT_INFO_FOR_PREFETCH
[thirdparty/git.git] / t / helper / test-dump-split-index.c
CommitLineData
8133061e 1#include "test-tool.h"
3e52f70b
NTND
2#include "cache.h"
3#include "split-index.h"
4#include "ewah/ewok.h"
5
6static void show_bit(size_t pos, void *data)
7{
8 printf(" %d", (int)pos);
9}
10
8133061e 11int cmd__dump_split_index(int ac, const char **av)
3e52f70b
NTND
12{
13 struct split_index *si;
14 int i;
15
16 do_read_index(&the_index, av[1], 1);
75691ea3 17 printf("own %s\n", oid_to_hex(&the_index.oid));
3e52f70b
NTND
18 si = the_index.split_index;
19 if (!si) {
20 printf("not a split index\n");
21 return 0;
22 }
2182abd9 23 printf("base %s\n", oid_to_hex(&si->base_oid));
3e52f70b
NTND
24 for (i = 0; i < the_index.cache_nr; i++) {
25 struct cache_entry *ce = the_index.cache[i];
26 printf("%06o %s %d\t%s\n", ce->ce_mode,
99d1a986 27 oid_to_hex(&ce->oid), ce_stage(ce), ce->name);
3e52f70b
NTND
28 }
29 printf("replacements:");
475a3445
DT
30 if (si->replace_bitmap)
31 ewah_each_bit(si->replace_bitmap, show_bit, NULL);
3e52f70b 32 printf("\ndeletions:");
475a3445
DT
33 if (si->delete_bitmap)
34 ewah_each_bit(si->delete_bitmap, show_bit, NULL);
3e52f70b
NTND
35 printf("\n");
36 return 0;
37}