Simplify cases where a strbuf_reset is immediately followed by a strbuf_add by using strbuf_set operations. Signed-off-by: Jeremiah Mahler <jmmahler@xxxxxxxxx> --- 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 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html