Re: [PATCH] builtin-apply: use strbuf's instead of buffer_desc's.
On Sun, Sep 16, 2007 at 12:56:49AM +0000, Junio C Hamano wrote:
Show 19 quoted lines
> Pierre Habouzit <madcoder@debian.org> writes:
>
> > 1 files changed, 73 insertions(+), 130 deletions(-)
>
> Nice reduction.
>
> > - }
> > - return got != size;
> > +
> > + nsize = buf->len;
> > + nbuf = convert_to_git(path, buf->buf, &nsize);
> > + if (nbuf)
> > + strbuf_embed(buf, nbuf, nsize, nsize);
> > + return 0;
>
>
> I suspect that changing the convert_to_git() interface to work
> on strbuf instead of (char*, size_t *) pair might make things
> simpler and easier.
Well, yes, maybe it could use:
(const char *, char *, size_t, struct strbuf *out);
But this function is used elsewhere where there isn't strbuf's (yet ?)
so I wasn't willing to do such a big change. But as you seem to think it
would help, I'll evaluate where it's going.
--
·O· Pierre Habouzit
··O madcoder@debian.org
OOO http://www.madism.org