aboutsummaryrefslogtreecommitdiffstats
path: root/repo-settings.h
diff options
context:
space:
mode:
authorKarthik Nayak <karthik.188@gmail.com>2024-12-03 15:44:02 +0100
committerJunio C Hamano <gitster@pobox.com>2024-12-04 08:21:55 +0900
commitd284713bae71877577cf1a07501c8528f8c44bb2 (patch)
treed933aa2b54f2d8d92d56b8e9aeaa055404fc9df4 /repo-settings.h
parentconfig: make `delta_base_cache_limit` a non-global variable (diff)
downloadgit-d284713bae71877577cf1a07501c8528f8c44bb2.tar.gz
git-d284713bae71877577cf1a07501c8528f8c44bb2.zip
config: make `packed_git_(limit|window_size)` non-global variables
The variables `packed_git_window_size` and `packed_git_limit` are global config variables used in the `packfile.c` file. Since it is only used in this file, let's change it from being a global config variable to a local variable for the subsystem. With this, we rid `packfile.c` from all global variable usage and this means we can also remove the `USE_THE_REPOSITORY_VARIABLE` guard from the file. Helped-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'repo-settings.h')
-rw-r--r--repo-settings.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/repo-settings.h b/repo-settings.h
index 10a6f7ed64..93ea0c3274 100644
--- a/repo-settings.h
+++ b/repo-settings.h
@@ -59,6 +59,8 @@ struct repo_settings {
int warn_ambiguous_refs; /* lazily loaded via accessor */
size_t delta_base_cache_limit;
+ size_t packed_git_window_size;
+ size_t packed_git_limit;
};
#define REPO_SETTINGS_INIT { \
.index_version = -1, \
@@ -66,6 +68,8 @@ struct repo_settings {
.fetch_negotiation_algorithm = FETCH_NEGOTIATION_CONSECUTIVE, \
.warn_ambiguous_refs = -1, \
.delta_base_cache_limit = DEFAULT_DELTA_BASE_CACHE_LIMIT, \
+ .packed_git_window_size = DEFAULT_PACKED_GIT_WINDOW_SIZE, \
+ .packed_git_limit = DEFAULT_PACKED_GIT_LIMIT, \
}
void prepare_repo_settings(struct repository *r);