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

[PATCH 3/6] test: avoid `options` variable

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Mar 28, 2023, 17:39 UTC
Message-ID
<20230328173932.3614601-4-felipe.contreras@gmail.com>
In-Reply-To
<20230328173932.3614601-1-felipe.contreras@gmail.com>
It has a special meaning in zsh.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 t/annotate-tests.sh              | 10 +++++-----
 t/t4051-diff-function-context.sh |  4 ++--
 t/t9300-fast-import.sh           |  4 ++--
 3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh
index f1b9a6ce4d..3b57d4dbb5 100644
--- a/t/annotate-tests.sh
+++ b/t/annotate-tests.sh
@@ -15,19 +15,19 @@ fi
 check_count () {
 	head= &&
 	file='file' &&
-	options= &&
+	args= &&
 	while :
 	do
 		case "$1" in
 		-h) head="$2"; shift; shift ;;
 		-f) file="$2"; shift; shift ;;
-		-L*) options="$options $(sanitize_L "$1")"; shift ;;
-		-*) options="$options $1"; shift ;;
+		-L*) args="$args $(sanitize_L "$1")"; shift ;;
+		-*) args="$args $1"; shift ;;
 		*) break ;;
 		esac
 	done &&
-	echo "$PROG $options $file $head" >&4 &&
-	$PROG $options $file $head >actual &&
+	echo "$PROG $args $file $head" >&4 &&
+	$PROG $args $file $head >actual &&
 	perl -e '
 		my %expect = (@ARGV);
 		my %count = map { $_ => 0 } keys %expect;
diff --git a/t/t4051-diff-function-context.sh b/t/t4051-diff-function-context.sh
index 725278ad19..3bf4f0b6b0 100755
--- a/t/t4051-diff-function-context.sh
+++ b/t/t4051-diff-function-context.sh
@@ -30,10 +30,10 @@ last_context_line () {
 check_diff () {
 	name=$1
 	desc=$2
-	options="-W $3"
+	args="-W $3"
 
 	test_expect_success "$desc" '
-		git diff $options "$name^" "$name" >"$name.diff"
+		git diff $args "$name^" "$name" >"$name.diff"
 	'
 
 	test_expect_success ' diff applies' '
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index aa55b41b9a..c30503870f 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -3222,7 +3222,7 @@ test_expect_success 'U: validate root delete result' '
 # fast-import process is still running using background_import_still_running
 # *after* evaluating the test conditions.
 background_import_then_checkpoint () {
-	options=$1
+	args=$1
 	input_file=$2
 
 	mkfifo V.input
@@ -3234,7 +3234,7 @@ background_import_then_checkpoint () {
 	rm V.output
 
 	(
-		git fast-import $options <&8 >&9 &
+		git fast-import $args <&8 >&9 &
 		echo $! >&9
 		wait $!
 		echo >&2 "background fast-import terminated too early with exit code $?"
-- 
2.39.2.13.g1fb56cf030
Previous: Felipe ContrerasNext: Felipe Contreras
Message 2 of 29 in “test: make the test suite work with zsh”
  1. 0/6 test: make the test suite work with zshFelipe Contreras, Mar 28, 2023
  2. 3/6 test: avoid `options` variableFelipe Contreras, Mar 28, 2023
  3. 1/6 test: fix build for zshFelipe Contreras, Mar 28, 2023
  4. 5/6 test: hack for zshFelipe Contreras, Mar 28, 2023
  5. Felipe ContrerasMar 30, 2023
  6. 6/6 mergetools: vimdiff: check for empty fieldsFelipe Contreras, Mar 28, 2023
  7. 2/6 test: avoid `stat` variableFelipe Contreras, Mar 28, 2023
  8. Ævar Arnfjörð BjarmasonMar 29, 2023
  9. Taylor BlauApr 1, 2023
  10. Felipe ContrerasApr 1, 2023
  11. 4/6 test: avoid `path` variableFelipe Contreras, Mar 28, 2023
  12. brian m. carlsonMar 29, 2023
  13. Felipe ContrerasMar 29, 2023
  14. Ævar Arnfjörð BjarmasonMar 29, 2023
  15. Felipe ContrerasMar 29, 2023
  16. Felipe ContrerasMar 30, 2023
  17. Junio C HamanoMar 29, 2023
  18. Felipe ContrerasMar 29, 2023
  19. Junio C HamanoMar 30, 2023
  20. Felipe ContrerasMar 30, 2023
  21. Taylor BlauApr 1, 2023
  22. Felipe ContrerasApr 1, 2023
  23. Junio C HamanoApr 1, 2023
  24. Felipe ContrerasApr 1, 2023
  25. Taylor BlauApr 1, 2023
  26. Felipe ContrerasApr 1, 2023
  27. brian m. carlsonMar 29, 2023
  28. Junio C HamanoMar 30, 2023
  29. Felipe ContrerasMar 30, 2023

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.