mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
d6b2d21fbf
commit
d284713bae
17
config.c
17
config.c
@@ -1493,28 +1493,11 @@ static int git_default_core_config(const char *var, const char *value,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strcmp(var, "core.packedgitwindowsize")) {
|
||||
int pgsz_x2 = getpagesize() * 2;
|
||||
packed_git_window_size = git_config_ulong(var, value, ctx->kvi);
|
||||
|
||||
/* This value must be multiple of (pagesize * 2) */
|
||||
packed_git_window_size /= pgsz_x2;
|
||||
if (packed_git_window_size < 1)
|
||||
packed_git_window_size = 1;
|
||||
packed_git_window_size *= pgsz_x2;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strcmp(var, "core.bigfilethreshold")) {
|
||||
big_file_threshold = git_config_ulong(var, value, ctx->kvi);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strcmp(var, "core.packedgitlimit")) {
|
||||
packed_git_limit = git_config_ulong(var, value, ctx->kvi);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strcmp(var, "core.autocrlf")) {
|
||||
if (value && !strcasecmp(value, "input")) {
|
||||
auto_crlf = AUTO_CRLF_INPUT;
|
||||
|
||||
Reference in New Issue
Block a user