From: Phillip Wood Date: Tue, 10 Nov 2026 11:14:49 GMT Subject: Re: [PATCH 06/15] remote: handle NULL value for remote..tagOpt Message-ID: <3b91af26-c0aa-4442-b644-01fbdaef4f4d@gmail.com> In-Reply-To: Hi Thomas On 07/11/2026 08:42, Thomas Bachem via GitGitGadget wrote: > diff --git a/remote.c b/remote.c > index 71170f36a9..024cfc547d 100644 > --- a/remote.c > +++ b/remote.c > @@ -556,6 +556,8 @@ static int handle_config(const char *key, const char *value, > else > error(_("more than one uploadpack given, using the first")); > } else if (!strcmp(subkey, "tagopt")) { > + if (!value) > + return config_error_nonbool(key); > if (!strcmp(value, "--no-tags")) > remote->fetch_tags = -1; > else if (!strcmp(value, "--tags")) remote->fetch_tags = 2; } else if (!strcmp(subkey, "proxy")) { We silently ignore invalid values which seems unfortunate, we could just print a warning for a missing value rather than dying, but at least with this change we are reporting an error. Thanks Phillip > diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh > index 5fbfcb0848..bec2e51afa 100755 > --- a/t/t5505-remote.sh > +++ b/t/t5505-remote.sh > @@ -90,6 +90,11 @@ test_expect_success 'remote information for the origin' ' > ) > ' > > +test_expect_success 'tagOpt needs a value' ' > + test_must_fail git -C test -c remote.origin.tagOpt remote 2>err && > + test_grep "missing value for .remote.origin.tagopt." err > +' > + > test_expect_success 'add another remote' ' > ( > cd test &&