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

[PATCH] test suite: correct export var=val usage

From
Jay Soffian <jaysoffian@gmail.com>
Date
Feb 17, 2009, 22:53 UTC
Message-ID
<1234911188-36941-1-git-send-email-jaysoffian@gmail.com>
In-Reply-To
<7vr61w3dug.fsf@gitster.siamese.dyndns.org>
Some shells do not like "export var=val", and the right way to write
these is to do an usual assignment and then export just variable names.
---
 t/t3301-notes.sh                 |    6 +++---
 t/t3302-notes-index-expensive.sh |    4 ++--
 t/t9301-fast-export.sh           |    4 ++--
 t/test-lib.sh                    |    2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh
index 2321316..7ea98f2 100755
--- a/t/t3301-notes.sh
+++ b/t/t3301-notes.sh
@@ -38,14 +38,14 @@ test_expect_success 'need valid notes ref' '
 '
 
 test_expect_success 'refusing to edit in refs/heads/' '
-	(MSG=1 GIT_NOTES_REF=refs/heads/bogus &&
-	 export MSG= GIT_NOTES_REF=refs/heads/bogus &&
+	(MSG=1 GIT_NOTES_REF=refs/heads/bogus
+	 && export MSG GIT_NOTES_REF &&
 	 test_must_fail git notes edit)
 '
 
 test_expect_success 'refusing to edit in refs/remotes/' '
 	(MSG=1 GIT_NOTES_REF=refs/remotes/bogus &&
-	 export MSG= GIT_NOTES_REF=refs/heads/bogus &&
+	 export MSG GIT_NOTES_REF &&
 	 test_must_fail git notes edit)
 '
 
diff --git a/t/t3302-notes-index-expensive.sh b/t/t3302-notes-index-expensive.sh
index 00d27bf..0ef3e95 100755
--- a/t/t3302-notes-index-expensive.sh
+++ b/t/t3302-notes-index-expensive.sh
@@ -29,7 +29,7 @@ create_repo () {
 	done &&
 	git update-ref refs/heads/master $commit &&
 	{
-		export GIT_INDEX_FILE=.git/temp;
+		GIT_INDEX_FILE=.git/temp; export GIT_INDEX_FILE;
 		git rev-list HEAD | cat -n | sed "s/^[ 	][ 	]*/ /g" |
 		while read nr sha1; do
 			blob=$(echo note $nr | git hash-object -w --stdin) &&
@@ -63,7 +63,7 @@ cat > time_notes << \EOF
 	while [ $i -lt $2 ]; do
 		case $1 in
 		no-notes)
-			export GIT_NOTES_REF=non-existing
+			GIT_NOTES_REF=non-existing; export GIT_NOTES_REF
 		;;
 		notes)
 			unset GIT_NOTES_REF
diff --git a/t/t9301-fast-export.sh b/t/t9301-fast-export.sh
index 9985721..86c3760 100755
--- a/t/t9301-fast-export.sh
+++ b/t/t9301-fast-export.sh
@@ -185,8 +185,8 @@ test_expect_success 'submodule fast-export | fast-import' '
 
 '
 
-export GIT_AUTHOR_NAME='A U Thor'
-export GIT_COMMITTER_NAME='C O Mitter'
+GIT_AUTHOR_NAME='A U Thor'; export GIT_AUTHOR_NAME
+GIT_COMMITTER_NAME='C O Mitter'; export GIT_COMMITTER_NAME
 
 test_expect_success 'setup copies' '
 
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 2021446..7a847ec 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -98,7 +98,7 @@ do
 	-i|--i|--im|--imm|--imme|--immed|--immedi|--immedia|--immediat|--immediate)
 		immediate=t; shift ;;
 	-l|--l|--lo|--lon|--long|--long-|--long-t|--long-te|--long-tes|--long-test|--long-tests)
-		export GIT_TEST_LONG=t; shift ;;
+		GIT_TEST_LONG=t; export GIT_TEST_LONG; shift ;;
 	-h|--h|--he|--hel|--help)
 		help=t; shift ;;
 	-v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
-- 
1.6.2.rc1.218.g1b4fab
Previous: Junio C HamanoNext: Johannes Schindelin
Message 34 of 47 in “notes: only clean up message file when editing”
  1. 1/4 notes: only clean up message file when editingThomas Rast, Feb 14, 2009
  2. 2/4 notes: use GIT_EDITOR and core.editor over VISUAL/EDITORThomas Rast, Feb 14, 2009
  3. Johannes SchindelinFeb 14, 2009
  4. 3/4 t3301: fix confusing test for valid notes refThomas Rast, Feb 14, 2009
  5. Johannes SchindelinFeb 14, 2009
  6. 4/4 notes: refuse to edit notes outside refs/notes/Thomas Rast, Feb 14, 2009
  7. Johannes SchindelinFeb 14, 2009
  8. Thomas RastFeb 14, 2009
  9. 1/5 notes: only clean up message file when editingThomas Rast, Feb 14, 2009
  10. Junio C HamanoFeb 15, 2009
  11. 2/5 notes: use GIT_EDITOR and core.editor over VISUAL/EDITORThomas Rast, Feb 14, 2009
  12. 3/5 t3301: fix confusing quoting in test for valid notes refThomas Rast, Feb 14, 2009
  13. 4/5 t3301: use test_must_fail instead of !Thomas Rast, Feb 14, 2009
  14. Johannes SchindelinFeb 14, 2009
  15. Junio C HamanoFeb 15, 2009
  16. Thomas RastFeb 15, 2009
  17. Jeff KingFeb 15, 2009
  18. Thomas RastFeb 15, 2009
  19. Mike RalphsonFeb 17, 2009
  20. Jeff KingFeb 17, 2009
  21. Mike RalphsonFeb 17, 2009
  22. Jeff KingFeb 17, 2009
  23. Jeff KingFeb 18, 2009
  24. Johannes SchindelinFeb 18, 2009
  25. Jeff KingFeb 18, 2009
  26. Johannes SchindelinFeb 18, 2009
  27. Jeff KingFeb 19, 2009
  28. Johannes SchindelinFeb 19, 2009
  29. Jeff KingFeb 19, 2009
  30. Thomas RastFeb 17, 2009
  31. Thomas RastFeb 17, 2009
  32. Brandon CaseyFeb 17, 2009
  33. Junio C HamanoFeb 17, 2009
  34. test suite: correct export var=val usageJay Soffian, Feb 17, 2009
  35. Johannes SchindelinFeb 17, 2009
  36. Jay SoffianFeb 18, 2009
  37. test suite: correct export var=val usageJay Soffian, Feb 17, 2009
  38. test suite: correct export var=val usageJay Soffian, Feb 17, 2009
  39. Wincent ColaiutaFeb 18, 2009
  40. Jay SoffianFeb 18, 2009
  41. Jay SoffianFeb 18, 2009
  42. Johannes SchindelinFeb 18, 2009
  43. Wincent ColaiutaFeb 18, 2009
  44. Thomas RastFeb 18, 2009
  45. test suite: correct export var=val usageJay Soffian, Feb 18, 2009
  46. 5/5 notes: refuse to edit notes outside refs/notes/Thomas Rast, Feb 14, 2009
  47. Johannes SchindelinFeb 14, 2009

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.