environment: move access to "core.sharedRepository" into repo settings

Similar as with the preceding commit, we track "core.sharedRepository"
via a pair of global variables. Move them into `struct repo_settings` so
that we can instead track them per-repository.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2025-02-07 12:03:40 +01:00
committed by Junio C Hamano
parent 6f3fbed8ed
commit f1ce861c34
8 changed files with 58 additions and 58 deletions

View File

@@ -37,6 +37,9 @@ struct repo_settings {
int pack_use_bitmap_boundary_traversal;
int pack_use_multi_pack_reuse;
int shared_repository;
int shared_repository_initialized;
/*
* Does this repository have core.useReplaceRefs=true (on by
* default)? This provides a repository-scoped version of this
@@ -65,6 +68,7 @@ struct repo_settings {
char *hooks_path;
};
#define REPO_SETTINGS_INIT { \
.shared_repository = -1, \
.index_version = -1, \
.core_untracked_cache = UNTRACKED_CACHE_KEEP, \
.fetch_negotiation_algorithm = FETCH_NEGOTIATION_CONSECUTIVE, \
@@ -84,4 +88,9 @@ int repo_settings_get_warn_ambiguous_refs(struct repository *repo);
/* Read the value for "core.hooksPath". */
const char *repo_settings_get_hooks_path(struct repository *repo);
/* Read, set or reset the value for "core.sharedRepository". */
int repo_settings_get_shared_repository(struct repository *repo);
void repo_settings_set_shared_repository(struct repository *repo, int value);
void repo_settings_reset_shared_repository(struct repository *repo);
#endif /* REPO_SETTINGS_H */