1 #define USE_THE_REPOSITORY_VARIABLE
5 #include "read-cache-ll.h"
6 #include "repository.h"
8 #include "split-index.h"
11 static void show_bit(size_t pos
, void *data UNUSED
)
13 printf(" %d", (int)pos
);
16 int cmd__dump_split_index(int ac UNUSED
, const char **av
)
18 struct split_index
*si
;
21 setup_git_directory();
23 do_read_index(the_repository
->index
, av
[1], 1);
24 printf("own %s\n", oid_to_hex(&the_repository
->index
->oid
));
25 si
= the_repository
->index
->split_index
;
27 printf("not a split index\n");
30 printf("base %s\n", oid_to_hex(&si
->base_oid
));
31 for (i
= 0; i
< the_repository
->index
->cache_nr
; i
++) {
32 struct cache_entry
*ce
= the_repository
->index
->cache
[i
];
33 printf("%06o %s %d\t%s\n", ce
->ce_mode
,
34 oid_to_hex(&ce
->oid
), ce_stage(ce
), ce
->name
);
36 printf("replacements:");
37 if (si
->replace_bitmap
)
38 ewah_each_bit(si
->replace_bitmap
, show_bit
, NULL
);
39 printf("\ndeletions:");
40 if (si
->delete_bitmap
)
41 ewah_each_bit(si
->delete_bitmap
, show_bit
, NULL
);