refspec-api: avoid uninitialized field in refspec item
[git/git-svn.git] / t / helper / test-dump-split-index.c
blob4e2fdb5e30d1ae30b1f75b7e3ca636afa4c0e097
1 #include "test-tool.h"
2 #include "cache.h"
3 #include "split-index.h"
4 #include "ewah/ewok.h"
6 static void show_bit(size_t pos, void *data)
8 printf(" %d", (int)pos);
11 int cmd__dump_split_index(int ac, const char **av)
13 struct split_index *si;
14 int i;
16 do_read_index(&the_index, av[1], 1);
17 printf("own %s\n", sha1_to_hex(the_index.sha1));
18 si = the_index.split_index;
19 if (!si) {
20 printf("not a split index\n");
21 return 0;
23 printf("base %s\n", sha1_to_hex(si->base_sha1));
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,
27 oid_to_hex(&ce->oid), ce_stage(ce), ce->name);
29 printf("replacements:");
30 if (si->replace_bitmap)
31 ewah_each_bit(si->replace_bitmap, show_bit, NULL);
32 printf("\ndeletions:");
33 if (si->delete_bitmap)
34 ewah_each_bit(si->delete_bitmap, show_bit, NULL);
35 printf("\n");
36 return 0;