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

Re: [PATCH v3 2/2] difftool: add support for --trust-exit-code

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 27, 2014, 18:45 UTC
Message-ID
<xmqq38a9tkqt.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1414372542-3485-2-git-send-email-davvid@gmail.com>
David Aguilar <davvid@gmail.com> writes:
> +write_script .git/fail-right-file <<\EOF
> +echo "$2"
> +exit 1
> +EOF
This should be inside the next one, no?
Show 10 quoted lines
> +test_expect_success PERL 'difftool stops on error with --trust-exit-code' '
> +	>for-diff &&
> +	git add for-diff &&
> +	echo file>expect &&
> +	test_must_fail git difftool -y --trust-exit-code \
> +		--extcmd .git/fail-right-file branch >actual &&
> +	test_cmp expect actual &&
> +	git reset -- for-diff &&
> +	rm -f for-diff .git/fail-right-file
> +'
In other words, this squashed in.
 t/t7800-difftool.sh | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index 4b2f611..69bde7a 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -104,20 +104,19 @@ test_expect_success PERL 'difftool ignores exit code with --no-trust-exit-code'
 	git difftool -y --no-trust-exit-code -t error branch
 '
 
-write_script .git/fail-right-file <<\EOF
-echo "$2"
-exit 1
-EOF
-
 test_expect_success PERL 'difftool stops on error with --trust-exit-code' '
+	test_when_finished "rm -f for-diff .git/fail-right-file" &&
+	test_when_finished "git reset -- for-diff" &&
+	write_script .git/fail-right-file <<-\EOF &&
+	echo "$2"
+	exit 1
+	EOF
 	>for-diff &&
 	git add for-diff &&
-	echo file>expect &&
+	echo file >expect &&
 	test_must_fail git difftool -y --trust-exit-code \
 		--extcmd .git/fail-right-file branch >actual &&
-	test_cmp expect actual &&
-	git reset -- for-diff &&
-	rm -f for-diff .git/fail-right-file
+	test_cmp expect actual
 '
 
 test_expect_success PERL 'difftool honors --gui' '
Previous: David AguilarNext: David Aguilar
Message 8 of 9 in “difftool--helper: exit when reading a prompt answer fails”
  1. Johannes SixtOct 26, 2014
  2. David AguilarOct 27, 2014
  3. David AguilarOct 27, 2014
  4. Michael J GruberOct 27, 2014
  5. Junio C HamanoOct 27, 2014
  6. 1/2 t7800-difftool: use "test_must_fail grep" instead of "! grep"David Aguilar, Oct 27, 2014
  7. 2/2 difftool: add support for --trust-exit-codeDavid Aguilar, Oct 27, 2014
  8. Junio C HamanoOct 27, 2014
  9. David AguilarOct 28, 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.