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

[PATCH v3 2/2] t/t8003-blame-corner-cases.sh: Use here documents

From
Mike Hommey <mh@glandium.org>
Date
Jul 15, 2016, 23:23 UTC
Message-ID
<20160715232346.12176-2-mh@glandium.org>
In-Reply-To
<20160715232346.12176-1-mh@glandium.org>
Somehow, this test was using:
{
	echo A
	echo B
} > file

block to feed file contents. This changes those to the form most common in git test scripts:

cat >file <<-\EOF A B EOF

Signed-off-by: Mike Hommey <mh@glandium.org>
---
 t/t8003-blame-corner-cases.sh | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/t/t8003-blame-corner-cases.sh b/t/t8003-blame-corner-cases.sh
index eab2e28..e48370d 100755
--- a/t/t8003-blame-corner-cases.sh
+++ b/t/t8003-blame-corner-cases.sh
@@ -41,12 +41,12 @@ test_expect_success setup '
 	test_tick &&
 	GIT_AUTHOR_NAME=Fourth git commit -m Fourth &&
 
-	{
-		echo ABC
-		echo DEF
-		echo XXXX
-		echo GHIJK
-	} >cow &&
+	cat >cow <<-\EOF &&
+	ABC
+	DEF
+	XXXX
+	GHIJK
+	EOF
 	git add cow &&
 	test_tick &&
 	GIT_AUTHOR_NAME=Fifth git commit -m Fifth
@@ -115,11 +115,11 @@ test_expect_success 'append with -C -C -C' '
 test_expect_success 'blame wholesale copy' '
 
 	git blame -f -C -C1 HEAD^ -- cow | sed -e "$pick_fc" >current &&
-	{
-		echo mouse-Initial
-		echo mouse-Second
-		echo mouse-Third
-	} >expected &&
+	cat >expected <<-\EOF &&
+	mouse-Initial
+	mouse-Second
+	mouse-Third
+	EOF
 	test_cmp expected current
 
 '
@@ -127,12 +127,12 @@ test_expect_success 'blame wholesale copy' '
 test_expect_success 'blame wholesale copy and more' '
 
 	git blame -f -C -C1 HEAD -- cow | sed -e "$pick_fc" >current &&
-	{
-		echo mouse-Initial
-		echo mouse-Second
-		echo cow-Fifth
-		echo mouse-Third
-	} >expected &&
+	cat >expected <<-\EOF &&
+	mouse-Initial
+	mouse-Second
+	cow-Fifth
+	mouse-Third
+	EOF
 	test_cmp expected current
 
 '
-- 
2.9.1.277.gdbc86c9.dirty
Previous: Mike HommeyNext: Johannes Schindelin
Message 13 of 15 in “blame: Allow to blame paths freshly added to the index”
  1. blame: Allow to blame paths freshly added to the indexMike Hommey, Jul 15, 2016
  2. Johannes SchindelinJul 15, 2016
  3. Mike HommeyJul 15, 2016
  4. Jeff KingJul 15, 2016
  5. Mike HommeyJul 15, 2016
  6. blame: Allow to blame paths freshly added to the indexMike Hommey, Jul 15, 2016
  7. Johannes SchindelinJul 15, 2016
  8. Junio C HamanoJul 15, 2016
  9. Junio C HamanoJul 15, 2016
  10. Mike HommeyJul 15, 2016
  11. Junio C HamanoJul 18, 2016
  12. 1/2 blame: Allow to blame paths freshly added to the indexMike Hommey, Jul 15, 2016
  13. 2/2 t/t8003-blame-corner-cases.sh: Use here documentsMike Hommey, Jul 15, 2016
  14. Johannes SchindelinJul 16, 2016
  15. Junio C HamanoJul 18, 2016

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.