From: Jeremiah Mahler Date: Mon, 09 Jun 2014 22:19:36 GMT Subject: [PATCH v2 17/19] transport: simplify via strbuf_set() Message-ID: <090cdfb1c698b40b55828793c031f3723f2cb216.1402348696.git.jmmahler@gmail.com> In-Reply-To: Simplify cases where a strbuf_reset is immediately followed by a strbuf_add by using strbuf_set operations. Signed-off-by: Jeremiah Mahler --- transport.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/transport.c b/transport.c index 172b3d8..e8f5dfa 100644 --- a/transport.c +++ b/transport.c @@ -1092,8 +1092,7 @@ static int run_pre_push_hook(struct transport *transport, if (r->status == REF_STATUS_REJECT_STALE) continue; if (r->status == REF_STATUS_UPTODATE) continue; - strbuf_reset(&buf); - strbuf_addf( &buf, "%s %s %s %s\n", + strbuf_setf( &buf, "%s %s %s %s\n", r->peer_ref->name, sha1_to_hex(r->new_sha1), r->name, sha1_to_hex(r->old_sha1)); -- 2.0.0.592.gf55b190