From: Jonathan Nieder Date: Sun, 29 Aug 2010 21:36:18 GMT Subject: Re: [PATCH 03/13] transport-helper: factor out push_update_refs_status Message-ID: <20100829213618.GD1890@burratino> In-Reply-To: <1283053540-27042-4-git-send-email-srabbelier@gmail.com> Sverre Rabbelier wrote: > +++ b/transport-helper.c > @@ -554,6 +554,9 @@ static int fetch(struct transport *transport, > return -1; > } > > +static void push_update_refs_status(struct helper_data *data, > + struct ref *remote_refs); > + > static int push_refs_with_push(struct transport *transport, > struct ref *remote_refs, int flags) > { > @@ -609,8 +612,17 @@ static int push_refs_with_push(struct transport *transport, [...] > +static void push_update_refs_status(struct helper_data *data, > + struct ref *remote_refs) > +{ > + struct strbuf buf = STRBUF_INIT; > + struct ref *ref = remote_refs; > while (1) { > char *refname, *msg; > int status; > @@ -679,7 +691,7 @@ static int push_refs_with_push(struct transport *transport, > ref->remote_status = msg; > } Hmm, I am not too happy with the long loop without explicit condition. Maybe it would make sense to split out the loop body as its own function? Something like struct ref *ref = remote_refs; for (;;) { recvline(data, &buf); if (!buf.len) break; push_update_ref_status(&buf, &ref, remote_refs); } > strbuf_release(&buf); > - return 0; > + return; Not necessary, I think. > } Regardless, for what it's worth, Reviewed-by: Jonathan Nieder Thanks for a pleasant read.