diff options
| author | Burak Kaan Karaçay <bkkaracay@gmail.com> | 2026-02-20 09:04:42 +0300 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-02-20 08:13:58 -0800 |
| commit | 6aea51bc3bf3c5318b97b5bddc405c29f1b23e8e (patch) | |
| tree | 782c9682b2cc2ed1561871888a8129d4507ea612 /environment.c | |
| parent | 999b09348d6302d018165b4b3d289d4579d08e9e (diff) | |
| download | git-6aea51bc3bf3c5318b97b5bddc405c29f1b23e8e.tar.xz | |
mailmap: drop global config variables
The 'mailmap.file' and 'mailmap.blob' configurations are currently
parsed and stored in the global variables 'git_mailmap_file' and
'git_mailmap_blob'. Since these values are typically only needed once
when initializing a mailmap, there is no need to keep them as global
state throughout the lifetime of the Git process.
To reduce global state, remove these global variables and instead use
'repo_config_get_*' functions to read the configuration on demand.
Signed-off-by: Burak Kaan Karaçay <bkkaracay@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'environment.c')
| -rw-r--r-- | environment.c | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/environment.c b/environment.c index 0026eb2274..2764d8f481 100644 --- a/environment.c +++ b/environment.c @@ -647,22 +647,6 @@ static int git_default_push_config(const char *var, const char *value) return 0; } -static int git_default_mailmap_config(const char *var, const char *value) -{ - if (!strcmp(var, "mailmap.file")) { - FREE_AND_NULL(git_mailmap_file); - return git_config_pathname(&git_mailmap_file, var, value); - } - - if (!strcmp(var, "mailmap.blob")) { - FREE_AND_NULL(git_mailmap_blob); - return git_config_string(&git_mailmap_blob, var, value); - } - - /* Add other config variables here and to Documentation/config.adoc. */ - return 0; -} - static int git_default_attr_config(const char *var, const char *value) { if (!strcmp(var, "attr.tree")) { @@ -697,9 +681,6 @@ int git_default_config(const char *var, const char *value, if (starts_with(var, "push.")) return git_default_push_config(var, value); - if (starts_with(var, "mailmap.")) - return git_default_mailmap_config(var, value); - if (starts_with(var, "attr.")) return git_default_attr_config(var, value); |
