| 851 | } |
| 852 | |
| 853 | void clear_incremental_midx_files(struct repository *r, |
| 854 | const struct strvec *keep_hashes) |
| 855 | { |
| 856 | struct odb_source *source = r->objects->sources; |
| 857 | struct strbuf chain = STRBUF_INIT; |
| 858 | |
| 859 | get_midx_chain_filename(source, &chain); |
| 860 | |
| 861 | for (; source; source = source->next) { |
| 862 | struct odb_source_files *files = odb_source_files_downcast(source); |
| 863 | if (files->packed->midx) |
| 864 | close_midx(files->packed->midx); |
| 865 | files->packed->midx = NULL; |
| 866 | } |
| 867 | |
| 868 | if (!keep_hashes && remove_path(chain.buf)) |
| 869 | die(_("failed to clear multi-pack-index chain at %s"), |
| 870 | chain.buf); |
| 871 | |
| 872 | clear_incremental_midx_files_ext(r->objects->sources, MIDX_EXT_BITMAP, |
| 873 | keep_hashes); |
| 874 | clear_incremental_midx_files_ext(r->objects->sources, MIDX_EXT_REV, |
| 875 | keep_hashes); |
| 876 | clear_incremental_midx_files_ext(r->objects->sources, MIDX_EXT_MIDX, |
| 877 | keep_hashes); |
| 878 | |
| 879 | strbuf_release(&chain); |
| 880 | } |
| 881 | |
| 882 | static int verify_midx_error; |
| 883 |
no test coverage detected