Thread (7 messages) 7 messages, 5 authors, 2019-07-27

Re: [PATCH v2] transport-helper: enforce atomic in push_refs_with_push

From: Junio C Hamano <hidden>
Date: 2019-07-16 16:54:06

Possibly related (same subject, not in this thread)

Carlo Arenas [off-list ref] writes:
On Tue, Jul 9, 2019 at 2:16 PM Emily Shaffer [off-list ref] wrote:
quoted
diff --git a/transport.c b/transport.c
index f1fcd2c4b0..d768bc275e 100644
--- a/transport.c
+++ b/transport.c
@@ -1226,6 +1226,19 @@ int transport_push(struct repository *r,
                err = push_had_errors(remote_refs);
                ret = push_ret | err;

+               if ((flags & TRANSPORT_PUSH_ATOMIC) && err) {
+                       for (struct ref *it = remote_refs; it; it = it->next)
moving "struct ref it" out of the loop, allows for building with ancient
compilers that don't support C90 (even if only by default) as I found
out while building pu in a Centos 6 box
Does everything else compile OK with your rather old compiler on
Centos 6?  I was historically rather pedantic to stick to C89 but
for past several years we've been experimenting with a bit more
modern features of the language to see if anybody screams (namely,
designated initializers in structs and arrays, and trailing comma in
enum definition) but I think we still reject variable definition in
for loop control (we saw and rewrote another patch that tried to use
it late last year).

Apparently, this one slipped our review process.

Thanks.

cf. https://public-inbox.org/git/xmqqwopgqsws.fsf@gitster-ct.c.googlers.com/
cf. https://public-inbox.org/git/xmqqmuuz9jih.fsf@gitster-ct.c.googlers.com/



 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help