aboutsummaryrefslogtreecommitdiffstats
path: root/config.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-08-26 11:10:18 -0700
committerJunio C Hamano <gitster@pobox.com>2024-08-26 11:10:18 -0700
commit5613c83f306870cbd0d4d4b3e7afb626c74536a8 (patch)
treedc8ded456b8487607e0036857ec2663059068c48 /config.c
parenta991ffff929e75509eb3bc4012cc43a2e6994f90 (diff)
parent615d2de3b457272216d4179ceb82b3b2b86b1929 (diff)
downloadgit-5613c83f306870cbd0d4d4b3e7afb626c74536a8.tar.gz
Merge branch 'tb/config-fixed-value-with-valueless-true' into maint-2.46
"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 */