Merge branch 'gc/use-repo-settings'

It is wrong to read some settings directly from the config
subsystem, as things like feature.experimental can affect their
default values.

* gc/use-repo-settings:
  gc: perform incremental repack when implictly enabled
  fsck: verify multi-pack-index when implictly enabled
  fsck: verify commit graph when implicitly enabled
This commit is contained in:
Junio C Hamano
2021-11-01 13:48:08 -07:00
6 changed files with 60 additions and 12 deletions

View File

@ -835,6 +835,7 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
fsck_enable_object_names(&fsck_walk_options);
git_config(git_fsck_config, &fsck_obj_options);
prepare_repo_settings(the_repository);
if (connectivity_only) {
for_each_loose_object(mark_loose_for_connectivity, NULL, 0);
@ -940,7 +941,7 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
check_connectivity();
if (!git_config_get_bool("core.commitgraph", &i) && i) {
if (the_repository->settings.core_commit_graph) {
struct child_process commit_graph_verify = CHILD_PROCESS_INIT;
const char *verify_argv[] = { "commit-graph", "verify", NULL, NULL, NULL };
@ -956,7 +957,7 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
}
}
if (!git_config_get_bool("core.multipackindex", &i) && i) {
if (the_repository->settings.core_multi_pack_index) {
struct child_process midx_verify = CHILD_PROCESS_INIT;
const char *midx_argv[] = { "multi-pack-index", "verify", NULL, NULL, NULL };