summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-07-16 20:28:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-07-16 20:30:33 (GMT)
commit2581ea3d31a178df6b073226f0ee0ab5b3ca3a24 (patch)
tree7b8297e1245ceba948eaf4accd0128fcc6113e52
parent3bca1e7f9f9708b970035a641d21f8c5cec1cd88 (diff)
downloadgit-2581ea3d31a178df6b073226f0ee0ab5b3ca3a24.zip
git-2581ea3d31a178df6b073226f0ee0ab5b3ca3a24.tar.gz
git-2581ea3d31a178df6b073226f0ee0ab5b3ca3a24.tar.bz2
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 <carenas@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--transport.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/transport.c b/transport.c
index d768bc2..453de8f 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: