summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-11-01 13:48:08 -0700
committerJunio C Hamano <gitster@pobox.com>2021-11-01 13:48:08 -0700
commit7afb458e9108632b7b9c32b08bfd7bca088e610c (patch)
tree50235f02e8e9d12e43bbb0accc04a0413334b04b /builtin
parentb82299ec6fe245595b3ac4abf5458bcb032ba62e (diff)
parenta897ab7ed143b2790f05785a3b1916f8a71c7a8c (diff)
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
Diffstat (limited to 'builtin')
-rw-r--r--builtin/fsck.c5
-rw-r--r--builtin/gc.c5
2 files changed, 5 insertions, 5 deletions
diff --git a/builtin/fsck.c b/builtin/fsck.c
index 30a516da29..d87c28a1cc 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -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 };
diff --git a/builtin/gc.c b/builtin/gc.c
index 6b3de3dd51..2670931160 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -1049,12 +1049,11 @@ static int maintenance_task_loose_objects(struct maintenance_run_opts *opts)
static int incremental_repack_auto_condition(void)
{
struct packed_git *p;
- int enabled;
int incremental_repack_auto_limit = 10;
int count = 0;
- if (git_config_get_bool("core.multiPackIndex", &enabled) ||
- !enabled)
+ prepare_repo_settings(the_repository);
+ if (!the_repository->settings.core_multi_pack_index)
return 0;
git_config_get_int("maintenance.incremental-repack.auto",