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

Re: [PATCH 2/2] transport-helper: fix remote helper namespace regression

From
Junio C Hamano <gitster@pobox.com>
Date
May 10, 2013, 20:28 UTC
Message-ID
<7vsj1uzijo.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1368187710-4434-3-git-send-email-felipe.contreras@gmail.com>
Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 8 quoted lines
> +test_expect_success 'push update refs failure' '
> +	(cd local &&
> +	git checkout update &&
> +	echo "update fail" >>file &&
> +	git commit -a -m "update fail" &&
> +	git rev-parse --verify testgit/origin/heads/update >expect &&
> +	GIT_REMOTE_TESTGIT_PUSH_ERROR="non-fast forward" \
> +	test_expect_code 1 git push origin update &&

This is not portable; as the remainder of this subshell does not mind having the environment, a simple fix may be something like:

	GIT_REMOTE_TESTGIT_PUSH_ERROR="..." &&
        exoprt GIT_REMOTE_TESTGIT_PUSH_ERROR &&
        test_expect_code 1 git push ... &&
Show 21 quoted lines
> +	git rev-parse --verify testgit/origin/heads/update >actual &&
> +	test_cmp expect actual
> +	)
> +'
> +
>  test_expect_success 'proper failure checks for fetching' '
>  	(GIT_REMOTE_TESTGIT_FAILURE=1 &&
>  	export GIT_REMOTE_TESTGIT_FAILURE &&
> diff --git a/transport-helper.c b/transport-helper.c
> index f11d78a..2f5ac3f 100644
> --- a/transport-helper.c
> +++ b/transport-helper.c
> @@ -705,7 +705,7 @@ static int push_update_ref_status(struct strbuf *buf,
>  
>  	(*ref)->status = status;
>  	(*ref)->remote_status = msg;
> -	return 0;
> +	return !(status == REF_STATUS_OK);
>  }
>  
>  static void push_update_refs_status(struct helper_data *data,
Previous: Junio C HamanoNext: Felipe Contreras
Message 5 of 7 in “transport-helper: fixes”
  1. 0/2 transport-helper: fixesFelipe Contreras, May 10, 2013
  2. 1/2 test: remote-helper: add missing andFelipe Contreras, May 10, 2013
  3. 2/2 transport-helper: fix remote helper namespace regressionFelipe Contreras, May 10, 2013
  4. Junio C HamanoMay 10, 2013
  5. Junio C HamanoMay 10, 2013
  6. Felipe ContrerasMay 10, 2013
  7. Junio C HamanoMay 10, 2013

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.