git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: Thomas Gummerer
Message 11 of 11 in “fetch --prune: exit with error if pruning fails”
  1. fetch --prune: exit with error if pruning failsThomas Gummerer, Jan 27, 2022
  2. Junio C HamanoJan 27, 2022
  3. Johannes SchindelinJan 28, 2022
  4. Thomas GummererJan 28, 2022
  5. Johannes SchindelinJan 28, 2022
  6. Junio C HamanoJan 28, 2022
  7. Thomas GummererJan 28, 2022
  8. Johannes SchindelinJan 28, 2022
  9. Thomas GummererJan 31, 2022
  10. fetch --prune: exit with error if pruning failsThomas Gummerer, Jan 31, 2022
  11. Junio C HamanoJan 31, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.