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

Function clear_incremental_midx_files

midx.c:853–880  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

851}
852
853void 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
882static int verify_midx_error;
883

Callers 2

write_midx_incrementalFunction · 0.85

Calls 7

get_midx_chain_filenameFunction · 0.85
close_midxFunction · 0.85
remove_pathFunction · 0.85
strbuf_releaseFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected