Re: [PATCH v2] fetch --prune: exit with error if pruning fails
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 31, 2022, 19:20 UTC
- Message-ID
- <xmqqh79jiuel.fsf@gitster.g>
- In-Reply-To
- <20220131133047.1885074-1-t.gummerer@gmail.com>
Thomas Gummerer <t.gummerer@gmail.com> writes:
Show 21 quoted lines
> diff --git a/builtin/fetch.c b/builtin/fetch.c
> index 5f06b21f8e..648f0694f2 100644
> --- a/builtin/fetch.c
> +++ b/builtin/fetch.c
> @@ -1609,12 +1609,14 @@ static int do_fetch(struct transport *transport,
> * don't care whether --tags was specified.
> */
> if (rs->nr) {
> - prune_refs(rs, ref_map, transport->url);
> + retcode = prune_refs(rs, ref_map, transport->url);
> } else {
> - prune_refs(&transport->remote->fetch,
> - ref_map,
> - transport->url);
> + retcode = prune_refs(&transport->remote->fetch,
> + ref_map,
> + transport->url);
> }
> + if (retcode != 0)
> + retcode = 1;
> }Looks trivially correct, even though a few style things look a bit irritating to my eyes ;-).
Thanks, will queue.