Re: [PATCH 06/15] remote: handle NULL value for remote.<name>.tagOpt
Hi Thomas
On 07/11/2026 08:42, Thomas Bachem via GitGitGadget wrote:
Show 13 quoted lines
> 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
Show 15 quoted lines
> 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 &&