Re: [PATCH 1/5] remote: don't use remote->{fetch,push}_refspec
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 16, 2017, 22:00 UTC
- Message-ID
- <xmqq60fvwq24.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20170616192837.11035-2-szeder.dev@gmail.com>
SZEDER Gábor <szeder.dev@gmail.com> writes:
Show 20 quoted lines
> diff --git a/remote.c b/remote.c
> index 336db8298..a021decee 100644
> --- a/remote.c
> +++ b/remote.c
> @@ -919,6 +919,26 @@ char *apply_refspecs(struct refspec *refspecs, int nr_refspec,
> return query.dst;
> }
>
> +void strbuf_add_refspec(struct strbuf *sb, const struct refspec *refspec)
> +{
> + if (refspec->force)
> + strbuf_addch(sb, '+');
> + if (refspec->src)
> + strbuf_addstr(sb, refspec->src);
> + if (refspec->dst) {
> + strbuf_addch(sb, ':');
> + strbuf_addstr(sb, refspec->dst);
> + } else if (!refspec->src)
> + strbuf_addch(sb, ':');
> +}Hmph, don't we support wildcarding (aka refspec->pattern)?
... goes and looks ...
Ah, even when we set the .pattern bit, we retain '*' in the string, so the above is correct.
The last one looks a bit sloppy; shouldn't it be inspecting the .matching bit?