MCPcopy Create free account
hub / github.com/git/git / clear_midx_file

Function clear_midx_file

midx.c:827–851  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

825}
826
827void 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
853void clear_incremental_midx_files(struct repository *r,
854 const struct strvec *keep_hashes)

Callers 1

Calls 7

get_midx_filenameFunction · 0.85
close_midxFunction · 0.85
remove_pathFunction · 0.85
clear_midx_files_extFunction · 0.85
strbuf_releaseFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected