summaryrefslogtreecommitdiffstats
path: root/config.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-08-14 23:54:51 +0200
committerJunio C Hamano <gitster@pobox.com>2024-08-14 23:54:51 +0200
commit4cf2f1be5639a3dc3e46ad7fbd71ad1dc16d5458 (patch)
treea844f13dc93a4df51dcf6433e7bbcfe9bbedd755 /config.c
parentMerge branch 'jk/apply-patch-mode-check-fix' (diff)
parentconfig.c: avoid segfault with --fixed-value and valueless config (diff)
downloadgit-4cf2f1be5639a3dc3e46ad7fbd71ad1dc16d5458.tar.xz
git-4cf2f1be5639a3dc3e46ad7fbd71ad1dc16d5458.zip
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 */