THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Git Source Code Mirror - This is a publish-only repository and all pull requests are ignored. Please follow Documentation/SubmittingPatches procedure for any of your improvements.
git
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

37 lines
861 B

  1. #include "cache.h"
  2. #include "split-index.h"
  3. #include "ewah/ewok.h"
  4. static void show_bit(size_t pos, void *data)
  5. {
  6. printf(" %d", (int)pos);
  7. }
  8. int main(int ac, char **av)
  9. {
  10. struct split_index *si;
  11. int i;
  12. do_read_index(&the_index, av[1], 1);
  13. printf("own %s\n", sha1_to_hex(the_index.sha1));
  14. si = the_index.split_index;
  15. if (!si) {
  16. printf("not a split index\n");
  17. return 0;
  18. }
  19. printf("base %s\n", sha1_to_hex(si->base_sha1));
  20. for (i = 0; i < the_index.cache_nr; i++) {
  21. struct cache_entry *ce = the_index.cache[i];
  22. printf("%06o %s %d\t%s\n", ce->ce_mode,
  23. sha1_to_hex(ce->sha1), ce_stage(ce), ce->name);
  24. }
  25. printf("replacements:");
  26. if (si->replace_bitmap)
  27. ewah_each_bit(si->replace_bitmap, show_bit, NULL);
  28. printf("\ndeletions:");
  29. if (si->delete_bitmap)
  30. ewah_each_bit(si->delete_bitmap, show_bit, NULL);
  31. printf("\n");
  32. return 0;
  33. }