aboutsummaryrefslogtreecommitdiffstats
path: root/config.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-08-14 14:54:51 -0700
committerJunio C Hamano <gitster@pobox.com>2024-08-14 14:54:51 -0700
commit4cf2f1be5639a3dc3e46ad7fbd71ad1dc16d5458 (patch)
treea844f13dc93a4df51dcf6433e7bbcfe9bbedd755 /config.c
parent0b2c4bc3ff6504467d84cb1bf6e73d877b553ce6 (diff)
parent615d2de3b457272216d4179ceb82b3b2b86b1929 (diff)
downloadgit-4cf2f1be5639a3dc3e46ad7fbd71ad1dc16d5458.tar.gz
Merge branch 'tb/config-fixed-value-with-valueless-true'
"git config --value=foo --fixed-value section.key newvalue" barfed when the existing value in the configuration file used the valueless true syntax, which has been corrected. * tb/config-fixed-value-with-valueless-true: config.c: avoid segfault with --fixed-value and valueless config
Diffstat (limited to 'config.c')
-rw-r--r--config.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/config.c b/config.c
index 6421894614..05f369ec0d 100644
--- a/config.c
+++ b/config.c
@@ -2914,7 +2914,7 @@ static int matches(const char *key, const char *value,
{
if (strcmp(key, store->key))
return 0; /* not ours */
- if (store->fixed_value)
+ if (store->fixed_value && value)
return !strcmp(store->fixed_value, value);
if (!store->value_pattern)
return 1; /* always matches */