Merge branch 'ds/maintenance-part-2'
"git maintenance", an extended big brother of "git gc", continues to evolve. * ds/maintenance-part-2: maintenance: add incremental-repack auto condition maintenance: auto-size incremental-repack batch maintenance: add incremental-repack task midx: use start_delayed_progress() midx: enable core.multiPackIndex by default maintenance: create auto condition for loose-objects maintenance: add loose-objects task maintenance: add prefetch task
This commit is contained in:
21
midx.c
21
midx.c
@ -10,6 +10,7 @@
|
||||
#include "progress.h"
|
||||
#include "trace2.h"
|
||||
#include "run-command.h"
|
||||
#include "repository.h"
|
||||
|
||||
#define MIDX_SIGNATURE 0x4d494458 /* "MIDX" */
|
||||
#define MIDX_VERSION 1
|
||||
@ -398,15 +399,9 @@ int prepare_multi_pack_index_one(struct repository *r, const char *object_dir, i
|
||||
{
|
||||
struct multi_pack_index *m;
|
||||
struct multi_pack_index *m_search;
|
||||
int config_value;
|
||||
static int env_value = -1;
|
||||
|
||||
if (env_value < 0)
|
||||
env_value = git_env_bool(GIT_TEST_MULTI_PACK_INDEX, 0);
|
||||
|
||||
if (!env_value &&
|
||||
(repo_config_get_bool(r, "core.multipackindex", &config_value) ||
|
||||
!config_value))
|
||||
prepare_repo_settings(r);
|
||||
if (!r->settings.core_multi_pack_index)
|
||||
return 0;
|
||||
|
||||
for (m_search = r->objects->multi_pack_index; m_search; m_search = m_search->next)
|
||||
@ -850,7 +845,7 @@ static int write_midx_internal(const char *object_dir, struct multi_pack_index *
|
||||
|
||||
packs.pack_paths_checked = 0;
|
||||
if (flags & MIDX_PROGRESS)
|
||||
packs.progress = start_progress(_("Adding packfiles to multi-pack-index"), 0);
|
||||
packs.progress = start_delayed_progress(_("Adding packfiles to multi-pack-index"), 0);
|
||||
else
|
||||
packs.progress = NULL;
|
||||
|
||||
@ -987,7 +982,7 @@ static int write_midx_internal(const char *object_dir, struct multi_pack_index *
|
||||
}
|
||||
|
||||
if (flags & MIDX_PROGRESS)
|
||||
progress = start_progress(_("Writing chunks to multi-pack-index"),
|
||||
progress = start_delayed_progress(_("Writing chunks to multi-pack-index"),
|
||||
num_chunks);
|
||||
for (i = 0; i < num_chunks; i++) {
|
||||
if (written != chunk_offsets[i])
|
||||
@ -1129,7 +1124,7 @@ int verify_midx_file(struct repository *r, const char *object_dir, unsigned flag
|
||||
}
|
||||
|
||||
if (flags & MIDX_PROGRESS)
|
||||
progress = start_progress(_("Looking for referenced packfiles"),
|
||||
progress = start_delayed_progress(_("Looking for referenced packfiles"),
|
||||
m->num_packs);
|
||||
for (i = 0; i < m->num_packs; i++) {
|
||||
if (prepare_midx_pack(r, m, i))
|
||||
@ -1250,7 +1245,7 @@ int expire_midx_packs(struct repository *r, const char *object_dir, unsigned fla
|
||||
count = xcalloc(m->num_packs, sizeof(uint32_t));
|
||||
|
||||
if (flags & MIDX_PROGRESS)
|
||||
progress = start_progress(_("Counting referenced objects"),
|
||||
progress = start_delayed_progress(_("Counting referenced objects"),
|
||||
m->num_objects);
|
||||
for (i = 0; i < m->num_objects; i++) {
|
||||
int pack_int_id = nth_midxed_pack_int_id(m, i);
|
||||
@ -1260,7 +1255,7 @@ int expire_midx_packs(struct repository *r, const char *object_dir, unsigned fla
|
||||
stop_progress(&progress);
|
||||
|
||||
if (flags & MIDX_PROGRESS)
|
||||
progress = start_progress(_("Finding and deleting unreferenced packfiles"),
|
||||
progress = start_delayed_progress(_("Finding and deleting unreferenced packfiles"),
|
||||
m->num_packs);
|
||||
for (i = 0; i < m->num_packs; i++) {
|
||||
char *pack_name;
|
||||
|
Reference in New Issue
Block a user