| 825 | } |
| 826 | |
| 827 | void clear_midx_file(struct repository *r) |
| 828 | { |
| 829 | struct strbuf midx = STRBUF_INIT; |
| 830 | |
| 831 | get_midx_filename(r->objects->sources, &midx); |
| 832 | |
| 833 | if (r->objects) { |
| 834 | struct odb_source *source; |
| 835 | |
| 836 | for (source = r->objects->sources; source; source = source->next) { |
| 837 | struct odb_source_files *files = odb_source_files_downcast(source); |
| 838 | if (files->packed->midx) |
| 839 | close_midx(files->packed->midx); |
| 840 | files->packed->midx = NULL; |
| 841 | } |
| 842 | } |
| 843 | |
| 844 | if (remove_path(midx.buf)) |
| 845 | die(_("failed to clear multi-pack-index at %s"), midx.buf); |
| 846 | |
| 847 | clear_midx_files_ext(r->objects->sources, MIDX_EXT_BITMAP, NULL); |
| 848 | clear_midx_files_ext(r->objects->sources, MIDX_EXT_REV, NULL); |
| 849 | |
| 850 | strbuf_release(&midx); |
| 851 | } |
| 852 | |
| 853 | void clear_incremental_midx_files(struct repository *r, |
| 854 | const struct strvec *keep_hashes) |
no test coverage detected