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

Re: [PATCH 6/6] merge hook tests: use 'test_must_fail' instead of '!'

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 6, 2014, 21:29 UTC
Message-ID
<xmqqiorrvwvh.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1394117424-29780-7-git-send-email-benoit.pierre@gmail.com>
Benoit Pierre <benoit.pierre@gmail.com> writes:
Show 15 quoted lines
> Signed-off-by: Benoit Pierre <benoit.pierre@gmail.com>
> ---
>  t/t7505-prepare-commit-msg-hook.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/t/t7505-prepare-commit-msg-hook.sh b/t/t7505-prepare-commit-msg-hook.sh
> index 604c06e..1be6cec 100755
> --- a/t/t7505-prepare-commit-msg-hook.sh
> +++ b/t/t7505-prepare-commit-msg-hook.sh
> @@ -167,7 +167,7 @@ test_expect_success 'with failing hook' '
>  	head=`git rev-parse HEAD` &&
>  	echo "more" >> file &&
>  	git add file &&
> -	! GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit -c $head
> +	test_must_fail env GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit -c $head
Thanks. It is good that you avoided the common pitfall of attempting
	GIT_EDITOR=... test_must_fail git commit -c $head    ;# WRONG
but do we assume everybody has "env"?
To be portable, we can do this instead.
	(
		GIT_EDITOR=... &&
        	export GIT_EDITOR &&
                test_must_fail git commit -c $head
	)
Previous: Benoit PierreNext: Junio C Hamano
Message 14 of 16 in “fix hunk editing with 'commit -p -m'”
  1. 0/6 fix hunk editing with 'commit -p -m'Benoit Pierre, Mar 6, 2014
  2. 1/6 test patch hunk editing with "commit -p -m"Benoit Pierre, Mar 6, 2014
  3. Eric SunshineMar 6, 2014
  4. Junio C HamanoMar 6, 2014
  5. 2/6 commit: fix patch hunk editing with "commit -p -m"Benoit Pierre, Mar 6, 2014
  6. Junio C HamanoMar 6, 2014
  7. Junio C HamanoMar 6, 2014
  8. 3/6 merge: fix GIT_EDITOR override for commit hookBenoit Pierre, Mar 6, 2014
  9. 4/6 merge hook tests: fix and update testsBenoit Pierre, Mar 6, 2014
  10. Eric SunshineMar 6, 2014
  11. 5/6 merge hook tests: fix missing '&&' in testBenoit Pierre, Mar 6, 2014
  12. Junio C HamanoMar 6, 2014
  13. 6/6 merge hook tests: use 'test_must_fail' instead of '!'Benoit Pierre, Mar 6, 2014
  14. Junio C HamanoMar 6, 2014
  15. Junio C HamanoMar 7, 2014
  16. Junio C HamanoMar 6, 2014

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.