git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: git@vger.kernel.org
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"SZEDER Gábor" <szeder.dev@gmail.com>,
	"Eric Sunshine" <sunshine@sunshineco.com>,
	"Felipe Contreras" <felipe.contreras@gmail.com>
Subject: [PATCH 2/6] test: avoid `stat` variable
Date: Tue, 28 Mar 2023 11:39:28 -0600	[thread overview]
Message-ID: <20230328173932.3614601-3-felipe.contreras@gmail.com> (raw)
In-Reply-To: <20230328173932.3614601-1-felipe.contreras@gmail.com>

It has special meaning in zsh.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 t/t0001-init.sh                | 4 ++--
 t/t3432-rebase-fast-forward.sh | 4 ++--
 t/t4013-diff-various.sh        | 6 +++---
 t/t5512-ls-remote.sh           | 4 ++--
 t/t5516-fetch-push.sh          | 8 ++++----
 t/test-lib.sh                  | 4 ++--
 6 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index 30a6edca1d..88c9de8f53 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -362,12 +362,12 @@ test_lazy_prereq GETCWD_IGNORES_PERMS '
 		cd $base/dir &&
 		test-tool getcwd
 	)
-	status=$?
+	stat=$?
 
 	chmod 700 $base &&
 	rm -rf $base ||
 	BUG "cannot clean $base"
-	return $status
+	return $stat
 '
 
 check_long_base_path () {
diff --git a/t/t3432-rebase-fast-forward.sh b/t/t3432-rebase-fast-forward.sh
index 7f1a5dd3de..49ecf8f18b 100755
--- a/t/t3432-rebase-fast-forward.sh
+++ b/t/t3432-rebase-fast-forward.sh
@@ -41,7 +41,7 @@ test_rebase_same_head () {
 }
 
 test_rebase_same_head_ () {
-	status="$1" &&
+	stat="$1" &&
 	shift &&
 	what="$1" &&
 	shift &&
@@ -57,7 +57,7 @@ test_rebase_same_head_ () {
 	else
 		msg="git rebase$flag $* with $changes is $what with $cmp HEAD"
 	fi &&
-	test_expect_$status "$msg" "
+	test_expect_$stat "$msg" "
 		if test $abbreviate -eq 1
 		then
 			test_config rebase.abbreviateCommands true
diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh
index 5de1d19075..8f82946c2f 100755
--- a/t/t4013-diff-various.sh
+++ b/t/t4013-diff-various.sh
@@ -178,7 +178,7 @@ process_diffs () {
 V=$(git version | sed -e 's/^git version //' -e 's/\./\\./g')
 while read magic cmd
 do
-	status=success
+	stat=success
 	case "$magic" in
 	'' | '#'*)
 		continue ;;
@@ -188,7 +188,7 @@ do
 		case "$magic" in
 		noellipses) ;;
 		failure)
-			status=failure
+			stat=failure
 			magic=
 			label="$cmd" ;;
 		*)
@@ -203,7 +203,7 @@ do
 	expect="$TEST_DIRECTORY/t4013/diff.$test"
 	actual="$pfx-diff.$test"
 
-	test_expect_$status "git $cmd # magic is ${magic:-(not used)}" '
+	test_expect_$stat "git $cmd # magic is ${magic:-(not used)}" '
 		{
 			echo "$ git $cmd"
 			case "$magic" in
diff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh
index 20d063fb9a..88f0f81baf 100755
--- a/t/t5512-ls-remote.sh
+++ b/t/t5512-ls-remote.sh
@@ -167,9 +167,9 @@ test_expect_success 'confuses pattern as remote when no remote specified' '
 test_expect_success 'die with non-2 for wrong repository even with --exit-code' '
 	{
 		git ls-remote --exit-code ./no-such-repository
-		status=$?
+		stat=$?
 	} &&
-	test $status != 2 && test $status != 0
+	test $stat != 2 && test $stat != 0
 '
 
 test_expect_success 'Report success even when nothing matches' '
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 19ebefa5ac..ed8b676156 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -1732,9 +1732,9 @@ test_expect_success 'updateInstead with push-to-checkout hook' '
 
 	git update-index -q --refresh &&
 	git read-tree -u -m HEAD "$1" || {
-		status=$?
+		stat=$?
 		echo >&2 read-tree failed
-		exit $status
+		exit $stat
 	}
 	EOF
 
@@ -1800,9 +1800,9 @@ test_expect_success 'updateInstead with push-to-checkout hook' '
 	no)
 		git read-tree -u -m "$1" ;;
 	esac || {
-		status=$?
+		stat=$?
 		echo >&2 read-tree failed
-		exit $status
+		exit $stat
 	}
 	EOF
 
diff --git a/t/test-lib.sh b/t/test-lib.sh
index cc705df981..621a10941d 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1866,12 +1866,12 @@ test_lazy_prereq SANITY '
 
 	! test -r SANETESTD.1/x &&
 	! rm SANETESTD.1/x && ! test -f SANETESTD.2/x
-	status=$?
+	stat=$?
 
 	chmod +rwx SANETESTD.1 SANETESTD.2 &&
 	rm -rf SANETESTD.1 SANETESTD.2 ||
 	BUG "cannot clean SANETESTD"
-	return $status
+	return $stat
 '
 
 test FreeBSD != $uname_s || GIT_UNZIP=${GIT_UNZIP:-/usr/local/bin/unzip}
-- 
2.39.2.13.g1fb56cf030


  parent reply	other threads:[~2023-03-28 17:40 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-28 17:39 [PATCH 0/6] test: make the test suite work with zsh Felipe Contreras
2023-03-28 17:39 ` [PATCH 1/6] test: fix build for zsh Felipe Contreras
2023-03-28 17:39 ` Felipe Contreras [this message]
2023-03-29  9:48   ` [PATCH 2/6] test: avoid `stat` variable Ævar Arnfjörð Bjarmason
2023-04-01  0:05   ` Taylor Blau
2023-04-01  0:25     ` Felipe Contreras
2023-03-28 17:39 ` [PATCH 3/6] test: avoid `options` variable Felipe Contreras
2023-03-28 17:39 ` [PATCH 4/6] test: avoid `path` variable Felipe Contreras
2023-03-28 17:39 ` [PATCH 5/6] test: hack for zsh Felipe Contreras
2023-03-30  8:15   ` Felipe Contreras
2023-03-28 17:39 ` [PATCH 6/6] mergetools: vimdiff: check for empty fields Felipe Contreras
2023-03-29  0:57 ` [PATCH 0/6] test: make the test suite work with zsh brian m. carlson
2023-03-29  1:57   ` Felipe Contreras
2023-03-29  9:51     ` Ævar Arnfjörð Bjarmason
2023-03-29 11:19       ` Felipe Contreras
2023-03-30 13:00         ` Felipe Contreras
2023-03-29 15:34   ` Junio C Hamano
2023-03-29 21:54     ` Felipe Contreras
2023-03-30 10:15       ` Junio C Hamano
2023-03-30 14:19         ` Felipe Contreras
2023-04-01  0:04           ` Taylor Blau
2023-04-01  0:59             ` Felipe Contreras
2023-04-01  1:30           ` Junio C Hamano
2023-04-01  2:39             ` Felipe Contreras
2023-04-01  0:00         ` Taylor Blau
2023-04-01  0:50           ` Felipe Contreras
2023-03-29 22:14     ` brian m. carlson
2023-03-30  3:15       ` Junio C Hamano
2023-03-30  7:47         ` Felipe Contreras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230328173932.3614601-3-felipe.contreras@gmail.com \
    --to=felipe.contreras@gmail.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=sunshine@sunshineco.com \
    --cc=szeder.dev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).