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

@@ -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;