]>
git.ipfire.org Git - thirdparty/git.git/blob - t/helper/test-dump-split-index.c
1 #define USE_THE_INDEX_VARIABLE
4 #include "split-index.h"
7 static void show_bit(size_t pos
, void *data
)
9 printf(" %d", (int)pos
);
12 int cmd__dump_split_index(int ac
, const char **av
)
14 struct split_index
*si
;
17 setup_git_directory();
19 do_read_index(&the_index
, av
[1], 1);
20 printf("own %s\n", oid_to_hex(&the_index
.oid
));
21 si
= the_index
.split_index
;
23 printf("not a split index\n");
26 printf("base %s\n", oid_to_hex(&si
->base_oid
));
27 for (i
= 0; i
< the_index
.cache_nr
; i
++) {
28 struct cache_entry
*ce
= the_index
.cache
[i
];
29 printf("%06o %s %d\t%s\n", ce
->ce_mode
,
30 oid_to_hex(&ce
->oid
), ce_stage(ce
), ce
->name
);
32 printf("replacements:");
33 if (si
->replace_bitmap
)
34 ewah_each_bit(si
->replace_bitmap
, show_bit
, NULL
);
35 printf("\ndeletions:");
36 if (si
->delete_bitmap
)
37 ewah_each_bit(si
->delete_bitmap
, show_bit
, NULL
);