aboutsummaryrefslogtreecommitdiffstats
path: root/config.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 /config.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 'config.c')
-rw-r--r--config.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/config.c b/config.c
index f1def0dcfb..1738c0cb0d 100644
--- a/config.c
+++ b/config.c
@@ -1291,6 +1291,7 @@ int git_config_pathname(char **dest, const char *var, const char *value)
if (is_optional && is_missing_file(path)) {
free(path);
+ *dest = NULL;
return 0;
}
@@ -1953,7 +1954,7 @@ int git_configset_get_maybe_bool(struct config_set *set, const char *key, int *d
return 1;
}
-int git_configset_get_pathname(struct config_set *set, const char *key, char **dest)
+static int git_configset_get_pathname(struct config_set *set, const char *key, char **dest)
{
const char *value;
if (!git_configset_get_value(set, key, &value, NULL))