Re: [PATCH/RFC 3/6] http-backend: handle refspec argument
- From
David Turner <dturner@twopensource.com>
- Date
- Apr 19, 2016, 18:57 UTC
- Message-ID
- <1461092277.5540.108.camel@twopensource.com>
- In-Reply-To
- <CAPig+cRSE-BCPdrSbrCYmTcT6EsabKnekr2GEAbmBsc5=jxnHQ@mail.gmail.com>
On Sat, 2016-04-16 at 21:51 -0400, Eric Sunshine wrote:
Show 16 quoted lines
> On Fri, Apr 15, 2016 at 3:19 PM, David Turner <
> dturner@twopensource.com> wrote:
> > + if (refspec) {
> > + struct strbuf interesting_refs =
> > STRBUF_INIT;
> > + strbuf_addstr(&interesting_refs, "-
> > -interesting-refs=");
> > + strbuf_addstr(&interesting_refs, refspec);
> > + argv_array_push(&argv,
> > interesting_refs.buf);
> > + strbuf_release(&interesting_refs);
> > + }
>
> if (refspec)
> argv_array_pushf(&interesting_refs,
> "--interesting-refs=%s", refspec);Will fix, thanks.
Show 10 quoted lines
> > argv_array_push(&argv, ".");
> > run_service(argv.argv, 0);
> > argv_array_clear(&argv);
> > @@ -841,6 +905,19 @@ int main(int argc, char **argv)
> > + if (starts_with(arg, "--interesting-refs=")) {
> > ...
> > + continue;
> > + }
>
> Is this leaking the string list?Yes, intentionally. interesting_refspec is a global that we look at later.