git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] remote: check config validity before creating rewrite struct

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 12, 2019, 02:36 UTC
Message-ID
<xmqq5zuuy53a.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20190111193011.GA19839@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 5 quoted lines
> This was a minor cleanup I mentioned in:
>
>   https://public-inbox.org/git/20181122173109.GI28192@sigill.intra.peff.net/
>
> but didn't get picked up.
Yeah, that does sound vaguely familiar ;-)  Thanks, will queue.
Show 25 quoted lines
>
>  remote.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/remote.c b/remote.c
> index 670dd44813..9cc3b07d21 100644
> --- a/remote.c
> +++ b/remote.c
> @@ -337,14 +337,14 @@ static int handle_config(const char *key, const char *value, void *cb)
>  		if (!name)
>  			return 0;
>  		if (!strcmp(subkey, "insteadof")) {
> -			rewrite = make_rewrite(&rewrites, name, namelen);
>  			if (!value)
>  				return config_error_nonbool(key);
> +			rewrite = make_rewrite(&rewrites, name, namelen);
>  			add_instead_of(rewrite, xstrdup(value));
>  		} else if (!strcmp(subkey, "pushinsteadof")) {
> -			rewrite = make_rewrite(&rewrites_push, name, namelen);
>  			if (!value)
>  				return config_error_nonbool(key);
> +			rewrite = make_rewrite(&rewrites_push, name, namelen);
>  			add_instead_of(rewrite, xstrdup(value));
>  		}
>  	}
Previous: Jeff King
Message 2 of 2 in “remote: check config validity before creating rewrite struct”
  1. remote: check config validity before creating rewrite structJeff King, Jan 11, 2019
  2. Junio C HamanoJan 12, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.