aboutsummaryrefslogtreecommitdiffstats
path: root/fmt-merge-msg.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-02-09 12:24:14 -0800
committerJunio C Hamano <gitster@pobox.com>2023-02-09 17:01:27 -0800
commitfd2d4c135ed974fdddf2af687748d28c58575984 (patch)
treee18cf51b6539a7517925f237ee76c8f84b57c5a1 /fmt-merge-msg.c
parent7876265d61cebef91f5b26db2dceab0fb95cfa3d (diff)
downloadgit-fd2d4c135ed974fdddf2af687748d28c58575984.tar.gz
gpg-interface: lazily initialize and read the configuration
Instead of forcing the porcelain commands to always read the configuration variables related to the signing and verifying signatures, lazily initialize the necessary subsystem on demand upon the first use. This hopefully would make it more future-proof as we do not have to think and decide whether we should call git_gpg_config() in the git_config() callback for each command. A few git_config() callback functions that used to be custom callbacks are now just a thin wrapper around git_default_config(). We could further remove, git_FOO_config and replace calls to git_config(git_FOO_config) with git_config(git_default_config), but to make it clear which ones are affected and the effect is only the removal of git_gpg_config(), it is vastly preferred not to do such a change in this step (they can be done on top once the dust settled). Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fmt-merge-msg.c')
-rw-r--r--fmt-merge-msg.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/fmt-merge-msg.c b/fmt-merge-msg.c
index f48f44f9cd..9b83c95a08 100644
--- a/fmt-merge-msg.c
+++ b/fmt-merge-msg.c
@@ -17,8 +17,6 @@ static struct string_list suppress_dest_patterns = STRING_LIST_INIT_DUP;
int fmt_merge_msg_config(const char *key, const char *value, void *cb)
{
- int status = 0;
-
if (!strcmp(key, "merge.log") || !strcmp(key, "merge.summary")) {
int is_bool;
merge_log_config = git_config_bool_or_int(key, value, &is_bool);
@@ -37,9 +35,6 @@ int fmt_merge_msg_config(const char *key, const char *value, void *cb)
string_list_append(&suppress_dest_patterns, value);
suppress_dest_pattern_seen = 1;
} else {
- status = git_gpg_config(key, value, NULL);
- if (status)
- return status;
return git_default_config(key, value, cb);
}
return 0;