| 777 | } |
| 778 | |
| 779 | void clear_midx_files_ext(struct odb_source *source, const char *ext, |
| 780 | const char *keep_hash) |
| 781 | { |
| 782 | struct clear_midx_data data = { |
| 783 | .keep = STRSET_INIT, |
| 784 | .ext = ext, |
| 785 | }; |
| 786 | |
| 787 | if (keep_hash) { |
| 788 | struct strbuf buf = STRBUF_INIT; |
| 789 | strbuf_addf(&buf, "multi-pack-index-%s.%s", keep_hash, ext); |
| 790 | |
| 791 | strset_add(&data.keep, buf.buf); |
| 792 | |
| 793 | strbuf_release(&buf); |
| 794 | } |
| 795 | |
| 796 | for_each_file_in_pack_dir(source->path, clear_midx_file_ext, &data); |
| 797 | |
| 798 | strset_clear(&data.keep); |
| 799 | } |
| 800 | |
| 801 | void clear_incremental_midx_files_ext(struct odb_source *source, const char *ext, |
| 802 | const struct strvec *keep_hashes) |
no test coverage detected