aboutsummaryrefslogtreecommitdiffstats
path: root/gpg-interface.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-12-05 14:49:56 +0900
committerJunio C Hamano <gitster@pobox.com>2025-12-05 14:49:56 +0900
commit0534b78576b410d10e2cfb61802ea829713bde03 (patch)
tree1c6c71b66cf0491260d82ae7008782e7b9ddcc68 /gpg-interface.c
parent5eadcbf8151f04d5c5bf0b8865ee8fa8447878f7 (diff)
parent0bd16856ffb3968de73699ad0555d1fae6c45406 (diff)
downloadgit-0534b78576b410d10e2cfb61802ea829713bde03.tar.gz
Merge branch 'jc/optional-path'
"git config get --path" segfaulted on an ":(optional)path" that does not exist, which has been corrected. * jc/optional-path: config: really treat missing optional path as not configured config: really pretend missing :(optional) value is not there config: mark otherwise unused function as file-scope static
Diffstat (limited to 'gpg-interface.c')
-rw-r--r--gpg-interface.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gpg-interface.c b/gpg-interface.c
index f680ed38c0..3e73513694 100644
--- a/gpg-interface.c
+++ b/gpg-interface.c
@@ -794,8 +794,16 @@ static int git_gpg_config(const char *var, const char *value,
fmtname = "ssh";
if (fmtname) {
+ char *program;
+ int status;
+
fmt = get_format_by_name(fmtname);
- return git_config_pathname((char **) &fmt->program, var, value);
+ status = git_config_pathname(&program, var, value);
+ if (status)
+ return status;
+ if (program)
+ fmt->program = program;
+ return status;
}
return 0;