Skip to content

Commit 2581ea3

Browse files
committed
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3bca1e7 commit 2581ea3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

transport.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,8 @@ int transport_push(struct repository *r,
12271227
ret = push_ret | err;
12281228

12291229
if ((flags & TRANSPORT_PUSH_ATOMIC) && err) {
1230-
for (struct ref *it = remote_refs; it; it = it->next)
1230+
struct ref *it;
1231+
for (it = remote_refs; it; it = it->next)
12311232
switch (it->status) {
12321233
case REF_STATUS_NONE:
12331234
case REF_STATUS_UPTODATE:

0 commit comments

Comments
 (0)