SZEDER Gábor <[email protected]> writes:
> 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?