Re: [PATCH, fixed] builtin-clone: create remotes/origin/HEAD symref, if guessed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 03, 2008 at 05:05:13PM +0000, Kristian Høgsberg wrote:
> On Sun, 2008-03-02 at 06:25 +0000, Johannes Schindelin wrote:
> > +		strbuf_init(&head_ref, 0);
> > +		strbuf_addstr(&head_ref, branch_top);
> > +		strbuf_addstr(&head_ref, "/HEAD");
> > +		delete_ref(head_ref.buf, head_points_at->old_sha1);
> > +		strbuf_init(&real_ref, 0);
> > +		strbuf_addstr(&real_ref, branch_top);
> > +		strbuf_addch(&real_ref, '/');
> > +		strbuf_addstr(&real_ref, head);
> 
> What about just using
> 
>   strbuf_addf(&real_ref, "%s/%s", branch_top, head);
> 
> Are you worried about performance? :-p

  If he was he would have used strbuf_init(&real_ref, 1024) or sth like
that I assume :)

> Oh and I'm wondering if
> 
>   strbuf_initf(&real_ref, "%s/%s", branch_top, head);
> 
> would be a worthwhile addition to the strbuf API...

  I don't think so, unless there are 1289 places in git that would
benefit from the shortcut it gives, but I really doubt it.

-- 
·O·  Pierre Habouzit
··O                                                madcoder@xxxxxxxxxx
OOO                                                http://www.madism.org

Attachment: pgpQ5ogIDZVPH.pgp
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux