"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Ryo ONODERA <ryo@tetera.org>
Subject:
POSIX shell portability fixes under regress/
To:
gameoftrees@openbsd.org
Date:
Mon, 28 Dec 2020 23:04:44 +0900

Download raw body.

Thread
Hi,

Thanks for your great software.

Some shell scripts under regress/ directory
use [s1 == s2] syntax to compare strings.
In POSIX way, this is defined as [s1 = s2].
See:
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html

Could you apply the following patch for commit
c80f5f010956d72c751b435eca30d106a3ac5a26 ?

I have read some emails that report bugs or new features in
the mailing list archive, however I am not sure how to submit my patch.
If I have mistakes, I will resend my patch in correct manner.

Thank you.


diff --git a/regress/cmdline/add.sh b/regress/cmdline/add.sh
index 85158592..a7fa1196 100755
--- a/regress/cmdline/add.sh
+++ b/regress/cmdline/add.sh
@@ -141,7 +141,7 @@ test_add_deleted() {
 	echo -n > $testroot/stdout.expected
 	(cd $testroot/wt && got add beta > $testroot/stdout 2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got add command succeeded unexpectedly" >&2
 		diff -u $testroot/stdout.expected $testroot/stdout
 		test_done "$testroot" "1"
@@ -280,7 +280,7 @@ test_add_clashes_with_submodule() {
 	(cd $testroot/wt && got commit -m 'add file repo2' \
 		> $testroot/stdout 2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "commit succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
diff --git a/regress/cmdline/blame.sh b/regress/cmdline/blame.sh
index d666c6b3..7fe69498 100755
--- a/regress/cmdline/blame.sh
+++ b/regress/cmdline/blame.sh
@@ -29,7 +29,7 @@ blame_cmp() {
 
 	cmp -s $testroot/${file}.blame.git $testroot/${file}.blame.got
 	ret="$?"
-	if [ "$ret" != "0" -a "$xfail" == "" ]; then
+	if [ "$ret" != "0" -a "$xfail" = "" ]; then
 		diff -u $testroot/${file}.blame.git $testroot/${file}.blame.got
 		return 1
 	fi
@@ -745,7 +745,7 @@ test_blame_submodule() {
 	got blame -r $testroot/repo repo2 \
 		> $testroot/stdout 2> $testroot/stderr
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "blame command succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -794,7 +794,7 @@ test_blame_symlink() {
 
 	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
-	if [ "$ret" != "0" -a "$xfail" == "" ]; then
+	if [ "$ret" != "0" -a "$xfail" = "" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
 		test_done "$testroot" "1"
 		return 1
@@ -815,7 +815,7 @@ test_blame_symlink() {
 
 	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
-	if [ "$ret" != "0" -a "$xfail" == "" ]; then
+	if [ "$ret" != "0" -a "$xfail" = "" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
 		test_done "$testroot" "1"
 		return 1
@@ -824,7 +824,7 @@ test_blame_symlink() {
 	got blame -r $testroot/repo epsilon.link > $testroot/stdout \
 		2> $testroot/stderr
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "blame command succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -844,7 +844,7 @@ test_blame_symlink() {
 	got blame -r $testroot/repo passwd.link > $testroot/stdout \
 		2> $testroot/stderr
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "blame command succeeded unexpectedly" >&2
 		test_done "$testroot" "$ret"
 		return 1
@@ -863,7 +863,7 @@ test_blame_symlink() {
 	got blame -r $testroot/repo nonexistent.link > $testroot/stdout \
 		2> $testroot/stderr
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "blame command succeeded unexpectedly" >&2
 		test_done "$testroot" "$ret"
 		return 1
diff --git a/regress/cmdline/branch.sh b/regress/cmdline/branch.sh
index 9fa183b2..a7662410 100755
--- a/regress/cmdline/branch.sh
+++ b/regress/cmdline/branch.sh
@@ -283,7 +283,7 @@ test_branch_delete() {
 	got branch -d bogus_branch_name -r $testroot/repo \
 		> $testroot/stdout 2> $testroot/stderr
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got update succeeded unexpectedly"
 		test_done "$testroot" "$ret"
 		return 1
@@ -376,7 +376,7 @@ test_branch_delete_packed() {
 	got branch -d bogus_branch_name -r $testroot/repo \
 		> $testroot/stdout 2> $testroot/stderr
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got update succeeded unexpectedly"
 		test_done "$testroot" "$ret"
 		return 1
diff --git a/regress/cmdline/cat.sh b/regress/cmdline/cat.sh
index f2bd8da0..0c5c8ea1 100755
--- a/regress/cmdline/cat.sh
+++ b/regress/cmdline/cat.sh
@@ -213,7 +213,7 @@ test_cat_submodule() {
 	got cat -r $testroot/repo repo2 > $testroot/stdout \
 		> $testroot/stdout 2> $testroot/stderr
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "cat command succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
diff --git a/regress/cmdline/checkout.sh b/regress/cmdline/checkout.sh
index 0db983c0..73b3ac7e 100755
--- a/regress/cmdline/checkout.sh
+++ b/regress/cmdline/checkout.sh
@@ -111,7 +111,7 @@ test_checkout_dir_not_empty() {
 	got checkout $testroot/repo $testroot/wt > $testroot/stdout \
 		2> $testroot/stderr
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "checkout succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -183,7 +183,7 @@ test_checkout_commit_from_wrong_branch() {
 	got checkout -b master -c $head_rev $testroot/repo $testroot/wt \
 		> $testroot/stdout 2> $testroot/stderr
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		test_done "$testroot" "1"
 		return 1
 	fi
@@ -372,7 +372,7 @@ test_checkout_into_nonempty_dir() {
 	got checkout $testroot/repo $testroot/wt > $testroot/stdout \
 		2> $testroot/stderr
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "checkout succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -770,7 +770,7 @@ test_checkout_repo_with_unknown_extension() {
 		> $testroot/stdout 2> $testroot/stderr
 
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got checkout command succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
diff --git a/regress/cmdline/cherrypick.sh b/regress/cmdline/cherrypick.sh
index 759292c2..31ae8906 100755
--- a/regress/cmdline/cherrypick.sh
+++ b/regress/cmdline/cherrypick.sh
@@ -198,7 +198,7 @@ test_cherrypick_into_work_tree_with_conflicts() {
 	(cd $testroot/wt && got cherrypick $branch_rev \
 		> $testroot/stdout 2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "cherrypick succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
diff --git a/regress/cmdline/commit.sh b/regress/cmdline/commit.sh
index 79cd9c89..1e055a9b 100755
--- a/regress/cmdline/commit.sh
+++ b/regress/cmdline/commit.sh
@@ -557,7 +557,7 @@ test_commit_selected_paths() {
 	(cd $testroot/wt && got commit -m 'many paths' nonexistent alpha \
 		> $testroot/stdout 2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "commit succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -607,7 +607,7 @@ test_commit_outside_refs_heads() {
 	(cd $testroot/wt && got commit -m 'change alpha' \
 		> $testroot/stdout 2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "commit succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -1122,7 +1122,7 @@ test_commit_symlink() {
 	(cd $testroot/wt && got commit -m 'test commit_symlink' \
 		> $testroot/stdout 2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got commit succeeded unexpectedly" >&2
 		test_done "$testroot" "$ret"
 		return 1
@@ -1200,7 +1200,7 @@ test_commit_symlink() {
 	(cd $testroot/wt && got commit -m 'test commit_symlink' \
 		> $testroot/stdout 2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got commit succeeded unexpectedly" >&2
 		test_done "$testroot" "$ret"
 		return 1
diff --git a/regress/cmdline/common.sh b/regress/cmdline/common.sh
index 9c914803..4eb63f99 100644
--- a/regress/cmdline/common.sh
+++ b/regress/cmdline/common.sh
@@ -228,7 +228,7 @@ test_done()
 {
 	local testroot="$1"
 	local result="$2"
-	if [ "$result" == "0" ]; then
+	if [ "$result" = "0" ]; then
 		test_cleanup "$testroot" || return 1
 		if [ -z "$GOT_TEST_QUIET" ]; then
 			echo "ok"
diff --git a/regress/cmdline/diff.sh b/regress/cmdline/diff.sh
index 83704789..f37ba4bf 100755
--- a/regress/cmdline/diff.sh
+++ b/regress/cmdline/diff.sh
@@ -346,7 +346,7 @@ test_diff_submodule_of_same_repo() {
 	got diff -r $testroot/repo $epsilon_id $submodule_id \
 		> $testroot/stdout 2> $testroot/stderr
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "diff command succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
diff --git a/regress/cmdline/fetch.sh b/regress/cmdline/fetch.sh
index 3f5693ec..86e2e5c7 100755
--- a/regress/cmdline/fetch.sh
+++ b/regress/cmdline/fetch.sh
@@ -702,7 +702,7 @@ test_fetch_reference() {
 	got fetch -q -r $testroot/repo-clone -R refs/remotes/origin/main \
 		> $testroot/stdout 2> $testroot/stderr
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got fetch command succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -983,7 +983,7 @@ EOF
 	(cd $testroot/repo-clone && got fetch nonexistent \
 		> $testroot/stdout 2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got fetch command succeeded unexpectedly" >&2
 		diff -u $testroot/stderr.expected $testroot/stderr
 		test_done "$testroot" "1"
diff --git a/regress/cmdline/histedit.sh b/regress/cmdline/histedit.sh
index daf60185..82d727d0 100755
--- a/regress/cmdline/histedit.sh
+++ b/regress/cmdline/histedit.sh
@@ -541,7 +541,7 @@ test_histedit_edit() {
 	(cd $testroot/wt && got histedit -c > $testroot/stdout \
 		2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "histedit succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -664,7 +664,7 @@ test_histedit_fold_last_commit() {
 		> $testroot/stdout 2> $testroot/stderr)
 
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "histedit succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -711,7 +711,7 @@ test_histedit_missing_commit() {
 		> $testroot/stdout 2> $testroot/stderr)
 
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "histedit succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -864,7 +864,7 @@ test_histedit_path_prefix_drop() {
 		> $testroot/stdout 2> $testroot/stderr)
 
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "histedit succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -968,7 +968,7 @@ test_histedit_path_prefix_edit() {
 		> $testroot/stdout 2> $testroot/stderr)
 
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "histedit succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -1331,7 +1331,7 @@ test_histedit_duplicate_commit_in_script() {
 	(cd $testroot/wt && got histedit -F $testroot/histedit-script \
 		> $testroot/stdout 2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "histedit succeeded unexpectedly:" >&2
 		cat $testroot/stdout >&2
 		test_done "$testroot" "$ret"
diff --git a/regress/cmdline/import.sh b/regress/cmdline/import.sh
index 5d5816f7..487d5e7d 100755
--- a/regress/cmdline/import.sh
+++ b/regress/cmdline/import.sh
@@ -145,7 +145,7 @@ test_import_requires_new_branch() {
 	got import -b master -m 'init' -r $testroot/repo $testroot/tree \
 		> $testroot/stdout 2> $testroot/stderr
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "import command should have failed but did not"
 		test_done "$testroot" "1"
 		return 1
diff --git a/regress/cmdline/integrate.sh b/regress/cmdline/integrate.sh
index dcc2976d..8cf8d28b 100755
--- a/regress/cmdline/integrate.sh
+++ b/regress/cmdline/integrate.sh
@@ -176,7 +176,7 @@ test_integrate_requires_rebase_first() {
 	(cd $testroot/wt && got integrate newbranch \
 		> $testroot/stdout 2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got integrate succeeded unexpectedly"
 		test_done "$testroot" "$ret"
 		return 1
@@ -360,7 +360,7 @@ test_integrate_backwards_in_time() {
 	(cd $testroot/wt && got integrate master \
 		> $testroot/stdout 2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got integrate succeeded unexpectedly"
 		test_done "$testroot" "$ret"
 		return 1
diff --git a/regress/cmdline/log.sh b/regress/cmdline/log.sh
index 81ae9fc2..dafaee11 100755
--- a/regress/cmdline/log.sh
+++ b/regress/cmdline/log.sh
@@ -340,7 +340,7 @@ test_log_nonexistent_path() {
 	(cd $testroot/repo && got log this/does/not/exist \
 		> $testroot/stdout 2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "log command succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -465,7 +465,7 @@ test_log_end_at_commit() {
 	(cd $testroot/wt && got log -x nonexistent \
 		> $testroot/stdout 2> $testroot/stderr) 
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "log command succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -494,7 +494,7 @@ test_log_end_at_commit() {
 	(cd $testroot/wt && got log -x $empty_sha1 \
 		> $testroot/stdout 2> $testroot/stderr) 
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "log command succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -762,7 +762,7 @@ test_log_submodule() {
 	got log -p -r $testroot/repo -l1 repo2 \
 		> $testroot/stdout 2> $testroot/stderr
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "log command succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
diff --git a/regress/cmdline/rebase.sh b/regress/cmdline/rebase.sh
index 2f6c1977..f521fb10 100755
--- a/regress/cmdline/rebase.sh
+++ b/regress/cmdline/rebase.sh
@@ -270,7 +270,7 @@ test_rebase_continue() {
 	(cd $testroot/wt && got rebase -c > $testroot/stdout \
 		2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "rebase succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
diff --git a/regress/cmdline/ref.sh b/regress/cmdline/ref.sh
index e3bb018f..f680079f 100755
--- a/regress/cmdline/ref.sh
+++ b/regress/cmdline/ref.sh
@@ -91,7 +91,7 @@ test_ref_create() {
 	(cd $testroot/wt && got ref -s $commit_id refs/heads/symbolicref \
 		2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "git ref command succeeded unexpectedly"
 		test_done "$testroot" "1"
 		return 1
@@ -109,7 +109,7 @@ test_ref_create() {
 	# Attempt to create a reference without specifying a name
 	(cd $testroot/wt && got ref -c $commit_id 2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "git ref command succeeded unexpectedly"
 		test_done "$testroot" "1"
 		return 1
@@ -128,7 +128,7 @@ test_ref_create() {
 	(cd $testroot/wt && got ref -s refs/heads/symbolicref \
 		2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "git ref command succeeded unexpectedly"
 		test_done "$testroot" "1"
 		return 1
@@ -226,7 +226,7 @@ test_ref_delete() {
 	got ref -r $testroot/repo -d refs/heads/bogus_ref_name \
 		> $testroot/stdout 2> $testroot/stderr
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got ref succeeded unexpectedly"
 		test_done "$testroot" "$ret"
 		return 1
diff --git a/regress/cmdline/revert.sh b/regress/cmdline/revert.sh
index 30494f9d..9766243d 100755
--- a/regress/cmdline/revert.sh
+++ b/regress/cmdline/revert.sh
@@ -235,7 +235,7 @@ test_revert_no_arguments() {
 
 	(cd $testroot/wt && got revert > $testroot/stdout 2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "revert command succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -274,7 +274,7 @@ test_revert_directory() {
 
 	(cd $testroot/wt && got revert . > $testroot/stdout 2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got revert command succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
diff --git a/regress/cmdline/stage.sh b/regress/cmdline/stage.sh
index 529ce0b4..e511ff90 100755
--- a/regress/cmdline/stage.sh
+++ b/regress/cmdline/stage.sh
@@ -57,7 +57,7 @@ test_stage_no_changes() {
 	(cd $testroot/wt && got stage alpha beta > $testroot/stdout \
 		2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got stage command succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -128,7 +128,7 @@ test_stage_unversioned() {
 	(cd $testroot/wt && got stage unversioned-file > $testroot/stdout \
 		2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got stage command succeed unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -267,7 +267,7 @@ test_stage_conflict() {
 	(cd $testroot/wt && got stage alpha > $testroot/stdout \
 		2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got stage command succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -312,7 +312,7 @@ test_stage_out_of_date() {
 	(cd $testroot/wt && got stage alpha > $testroot/stdout \
 		2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got stage command succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -366,7 +366,7 @@ test_double_stage() {
 	(cd $testroot/wt && got stage beta \
 		> $testroot/stdout 2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got stage command succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -394,7 +394,7 @@ test_double_stage() {
 	(cd $testroot/wt && got stage -F $testroot/patchscript -p \
 		> $testroot/stdout 2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got stage command succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -624,7 +624,7 @@ test_stage_rm_already_staged_file() {
 		(cd $testroot/wt && got rm $f \
 			> $testroot/stdout 2> $testroot/stderr)
 		ret="$?"
-		if [ "$ret" == "0" ]; then
+		if [ "$ret" = "0" ]; then
 			echo "got rm command succeeded unexpectedly" >&2
 			test_done "$testroot" "1"
 			return 1
@@ -1032,7 +1032,7 @@ test_stage_histedit() {
 	(cd $testroot/wt && got histedit -F $testroot/histedit-script \
 		> $testroot/stdout 2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got histedit command succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -1091,7 +1091,7 @@ test_stage_rebase() {
 	(cd $testroot/wt && got rebase newbranch \
 		> $testroot/stdout 2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got rebase command succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -1134,7 +1134,7 @@ test_stage_update() {
 	(cd $testroot/wt && got update > $testroot/stdout  \
 		2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got update command succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -1178,7 +1178,7 @@ test_stage_commit_non_staged() {
 	(cd $testroot/wt && got commit -m "change delta" gamma/delta \
 		> $testroot/stdout 2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got commit command succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -1224,7 +1224,7 @@ test_stage_commit_out_of_date() {
 	(cd $testroot/wt && got commit -m "try to commit" > $testroot/stdout \
 		2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got commit command succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -1453,7 +1453,7 @@ test_stage_patch() {
 	(cd $testroot/wt && got stage -F $testroot/patchscript -p \
 		numbers > $testroot/stdout 2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got stage command succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -2002,7 +2002,7 @@ test_stage_patch_added_twice() {
 	(cd $testroot/wt && got stage -F $testroot/patchscript -p \
 		epsilon/new > $testroot/stdout 2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got stage command succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -2127,7 +2127,7 @@ test_stage_patch_removed_twice() {
 	(cd $testroot/wt && got stage -F $testroot/patchscript -p beta \
 		> $testroot/stdout 2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got stage command succeeded unexpectedly" >&2
 		test_done "$testroot" "$ret"
 		return 1
@@ -2284,7 +2284,7 @@ test_stage_patch_incomplete_script() {
 	(cd $testroot/wt && got stage -F $testroot/patchscript -p \
 		> $testroot/stdout 2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got stage command succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -2385,7 +2385,7 @@ test_stage_symlink() {
 
 	(cd $testroot/wt && got stage > $testroot/stdout 2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "got stage succeeded unexpectedly" >&2
 		test_done "$testroot" "$ret"
 		return 1
diff --git a/regress/cmdline/status.sh b/regress/cmdline/status.sh
index 09bd0ffd..551a9622 100755
--- a/regress/cmdline/status.sh
+++ b/regress/cmdline/status.sh
@@ -655,7 +655,7 @@ test_status_status_code() {
 	(cd $testroot/wt && got status -s xDM \
 		> $testroot/stdout 2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "status succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
diff --git a/regress/cmdline/tag.sh b/regress/cmdline/tag.sh
index 98ded056..c5ae022a 100755
--- a/regress/cmdline/tag.sh
+++ b/regress/cmdline/tag.sh
@@ -91,7 +91,7 @@ test_tag_create() {
 	(cd $testroot/wt && got tag -m 'test' -c $tree_id foobar \
 		2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "git tag command succeeded unexpectedly"
 		test_done "$testroot" "1"
 		return 1
diff --git a/regress/cmdline/tree.sh b/regress/cmdline/tree.sh
index 55ebc6f4..9ca64b4d 100755
--- a/regress/cmdline/tree.sh
+++ b/regress/cmdline/tree.sh
@@ -91,7 +91,7 @@ test_tree_submodule() {
 	# Currently fails in open(2)
 	got tree -r $testroot/repo repo2 > $testroot/stdout 2> $testroot/stderr
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "tree command succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
@@ -118,7 +118,7 @@ test_tree_submodule_of_same_repo() {
 	# Currently fails with "bad object data"
 	got tree -r $testroot/repo repo2 > $testroot/stdout 2> $testroot/stderr
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "tree command succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1
diff --git a/regress/cmdline/update.sh b/regress/cmdline/update.sh
index 543f12cd..a52e2675 100755
--- a/regress/cmdline/update.sh
+++ b/regress/cmdline/update.sh
@@ -1221,7 +1221,7 @@ test_update_partial_rm() {
 
 	(cd $testroot/wt && got update alpha epsilon/zeta 2> $testroot/stderr)
 	ret="$?"
-	if [ "$ret" == "0" ]; then
+	if [ "$ret" = "0" ]; then
 		echo "update succeeded unexpectedly" >&2
 		test_done "$testroot" "1"
 		return 1


-- 
Ryo ONODERA // ryo@tetera.org
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3