diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-11-20 11:45:35 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-11-24 17:00:47 -0800 |
| commit | 0bd16856ffb3968de73699ad0555d1fae6c45406 (patch) | |
| tree | 9d2c78d62c1e4588bd54ae78a59205747af6500c /builtin/receive-pack.c | |
| parent | ce1a5a22a5beefac8a52da518855b5aecc562874 (diff) | |
| download | git-0bd16856ffb3968de73699ad0555d1fae6c45406.tar.xz | |
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>
Diffstat (limited to 'builtin/receive-pack.c')
| -rw-r--r-- | builtin/receive-pack.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index 1113137a6f..4718573354 100644 --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@ -177,8 +177,9 @@ static int receive_pack_config(const char *var, const char *value, if (git_config_pathname(&path, var, value)) return -1; - strbuf_addf(&fsck_msg_types, "%cskiplist=%s", - fsck_msg_types.len ? ',' : '=', path); + if (path) + strbuf_addf(&fsck_msg_types, "%cskiplist=%s", + fsck_msg_types.len ? ',' : '=', path); free(path); return 0; } |
