Commit 54c39596938ae6d19fe5eede072d36a3f61baa12

Stefan Sperling 2020-12-28T17:38:34

use POSIX [s1 = s2] syntax instead of [s1 == s2]; patch by Ryo ONODERA

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
diff --git a/regress/cmdline/add.sh b/regress/cmdline/add.sh
index 8515859..a7fa119 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 d666c6b..7fe6949 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 9fa183b..a766241 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 f2bd8da..0c5c8ea 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 0db983c..73b3ac7 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 759292c..31ae890 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 79cd9c8..1e055a9 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 9c91480..4eb63f9 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 8370478..f37ba4b 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 3f5693e..86e2e5c 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 daf6018..82d727d 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 5d5816f..487d5e7 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 dcc2976..8cf8d28 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 81ae9fc..dafaee1 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 2f6c197..f521fb1 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 e3bb018..f680079 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 30494f9..9766243 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 529ce0b..e511ff9 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 09bd0ff..551a962 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 98ded05..c5ae022 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 55ebc6f..9ca64b4 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 543f12c..a52e267 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