mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
config: really treat missing optional path as not configured
These callers expect that git_config_pathname() that returns 0 is a signal that the variable they passed has a string they need to act on. But with the introduction of ":(optional)path" earlier, that is no longer the case. If the path specified by the configuration variable is missing, their variable will get a NULL in it, and they need to act on it (often, just refraining from copying it elsewhere). Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
@@ -1872,8 +1872,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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user