git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: git@vger.kernel.org, Jeff King <peff@peff.net>
Subject: Re: [PATCH 2/2] transport-helper: fix remote helper namespace regression
Date: Fri, 10 May 2013 13:28:11 -0700	[thread overview]
Message-ID: <7vsj1uzijo.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1368187710-4434-3-git-send-email-felipe.contreras@gmail.com> (Felipe Contreras's message of "Fri, 10 May 2013 07:08:30 -0500")

Felipe Contreras <felipe.contreras@gmail.com> writes:

> +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 ... &&

> +	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,

  parent reply	other threads:[~2013-05-10 20:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-10 12:08 [PATCH 0/2] transport-helper: fixes Felipe Contreras
2013-05-10 12:08 ` [PATCH 1/2] test: remote-helper: add missing and Felipe Contreras
2013-05-10 12:08 ` [PATCH 2/2] transport-helper: fix remote helper namespace regression Felipe Contreras
2013-05-10 14:35   ` Junio C Hamano
2013-05-10 20:28   ` Junio C Hamano [this message]
2013-05-10 20:36     ` Felipe Contreras
2013-05-10 20:55       ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vsj1uzijo.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).