From: SZEDER Gábor Date: Tue, 29 Jan 2019 11:15:54 GMT Subject: Re: [PATCH v2 6/8] evolve: Add support for writing metacommits Message-ID: <20190129111554.GA13764@szeder.dev> In-Reply-To: <20190127194128.161250-6-sxenos@google.com> On Sun, Jan 27, 2019 at 11:41:26AM -0800, sxenos@google.com wrote: > diff --git a/metacommit.c b/metacommit.c > +static void compute_change_name(struct commit *initial_commit, struct strbuf* result) > +{ > + struct strbuf default_name; > + struct object_id unused; > + > + strbuf_init(&default_name, 0); > + if (initial_commit) { > + compute_default_change_name(initial_commit, &default_name); > + } else { > + strbuf_addstr(&default_name, "change"); > + } > + strbuf_addstr(result, "refs/metas/"); > + strbuf_addstr(result, default_name.buf); Please use the slightly more efficient strbuf_addbuf() function instead.