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
This commit is contained in:
Junio C Hamano
2025-12-05 14:49:56 +09:00
11 changed files with 102 additions and 23 deletions

View File

@@ -1865,8 +1865,9 @@ int fetch_pack_fsck_config(const char *var, const char *value,
if (git_config_pathname(&path, var, value))
return -1;
strbuf_addf(msg_types, "%cskiplist=%s",
msg_types->len ? ',' : '=', path);
if (path)
strbuf_addf(msg_types, "%cskiplist=%s",
msg_types->len ? ',' : '=', path);
free(path);
return 0;
}