Re: [PATCH v2] transport-helper: enforce atomic in push_refs_with_push
- From
Carlo Arenas <carenas@gmail.com>
- Date
- Jul 16, 2019, 07:10 UTC
- Message-ID
- <CAPUEspgjSAqHUP2vsCCjqG8b0QkWdgoAByh4XdqsThQMt=V38w@mail.gmail.com>
- In-Reply-To
- <20190709211043.48597-1-emilyshaffer@google.com>
On Tue, Jul 9, 2019 at 2:16 PM Emily Shaffer <emilyshaffer@google.com> wrote:
Show 11 quoted lines
>
> 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
Carlo