From: Junio C Hamano Date: Tue, 16 Jul 2019 20:28:21 +0000 (-0700) Subject: transport-helper: avoid var decl in for () loop control X-Git-Tag: v2.23.0-rc0~19^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/2581ea3d31a178df6b073226f0ee0ab5b3ca3a24?hp=--cc transport-helper: avoid var decl in for () loop control We do allow a few selected C99 constructs in our codebase these days, but this is not among them (yet). Reported-by: Carlo Arenas Signed-off-by: Junio C Hamano --- 2581ea3d31a178df6b073226f0ee0ab5b3ca3a24 diff --git a/transport.c b/transport.c index d768bc275e..453de8f704 100644 --- a/transport.c +++ b/transport.c @@ -1227,7 +1227,8 @@ int transport_push(struct repository *r, ret = push_ret | err; if ((flags & TRANSPORT_PUSH_ATOMIC) && err) { - for (struct ref *it = remote_refs; it; it = it->next) + struct ref *it; + for (it = remote_refs; it; it = it->next) switch (it->status) { case REF_STATUS_NONE: case REF_STATUS_UPTODATE: