repo-settings: track defaults close to struct repo_settings

The default values for `struct repo_settings` are set up in
`prepare_repo_settings()`. This is somewhat different from how we
typically do this, namely by providing an `INIT` macro that sets up the
default values for us.

Refactor the code to do the same.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2024-09-12 13:30:07 +02:00
committed by Junio C Hamano
parent a0d09c56ba
commit f1d3d07900
2 changed files with 9 additions and 5 deletions

View File

@ -50,6 +50,11 @@ struct repo_settings {
int core_multi_pack_index;
};
#define REPO_SETTINGS_INIT { \
.index_version = -1, \
.core_untracked_cache = UNTRACKED_CACHE_KEEP, \
.fetch_negotiation_algorithm = FETCH_NEGOTIATION_CONSECUTIVE, \
}
void prepare_repo_settings(struct repository *r);