Commit 8d301dd94ca3964729aa83b8031e7502a1111f49

Stefan Sperling 2019-05-14T11:35:15

use cmp -s, instead of cmp, in all command line tests

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
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
diff --git a/regress/cmdline/add.sh b/regress/cmdline/add.sh
index ddbaf4a..da716a3 100755
--- a/regress/cmdline/add.sh
+++ b/regress/cmdline/add.sh
@@ -31,7 +31,7 @@ function test_add_basic {
 	echo 'A  foo' > $testroot/stdout.expected
 	(cd $testroot/wt && got add foo > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -88,7 +88,7 @@ function test_add_multiple {
 	echo "A  baz" >> $testroot/stdout.expected
 	echo "A  foo" >> $testroot/stdout.expected
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
diff --git a/regress/cmdline/checkout.sh b/regress/cmdline/checkout.sh
index 3123aa9..5ddd473 100755
--- a/regress/cmdline/checkout.sh
+++ b/regress/cmdline/checkout.sh
@@ -32,7 +32,7 @@ function test_checkout_basic {
 		return 1
 	fi
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -47,7 +47,7 @@ function test_checkout_basic {
 	cat $testroot/wt/alpha $testroot/wt/beta $testroot/wt/epsilon/zeta \
 	    $testroot/wt/gamma/delta > $testroot/content
 
-	cmp $testroot/content.expected $testroot/content
+	cmp -s $testroot/content.expected $testroot/content
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/content.expected $testroot/content
@@ -73,7 +73,7 @@ function test_checkout_sets_xbit {
 		return 1
 	fi
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
diff --git a/regress/cmdline/commit.sh b/regress/cmdline/commit.sh
index 668767c..454a290 100755
--- a/regress/cmdline/commit.sh
+++ b/regress/cmdline/commit.sh
@@ -39,7 +39,7 @@ function test_commit_basic {
 	echo "D  beta" >> $testroot/stdout.expected
 	echo "created commit $head_rev" >> $testroot/stdout.expected
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -71,7 +71,7 @@ function test_commit_new_subdir {
 	echo "A  d/new2" >> $testroot/stdout.expected
 	echo "created commit $head_rev" >> $testroot/stdout.expected
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -99,7 +99,7 @@ function test_commit_subdir {
 	echo "M  epsilon/zeta" >> $testroot/stdout.expected
 	echo "created commit $head_rev" >> $testroot/stdout.expected
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -127,7 +127,7 @@ function test_commit_single_file {
 	echo "M  epsilon/zeta" >> $testroot/stdout.expected
 	echo "created commit $head_rev" >> $testroot/stdout.expected
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -158,7 +158,7 @@ function test_commit_out_of_date {
 	echo "got: work tree must be updated before these" \
 		"changes can be committed" > $testroot/stderr.expected
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -166,7 +166,7 @@ function test_commit_out_of_date {
 		return 1
 	fi
 
-	cmp $testroot/stderr.expected $testroot/stderr
+	cmp -s $testroot/stderr.expected $testroot/stderr
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stderr.expected $testroot/stderr
diff --git a/regress/cmdline/diff.sh b/regress/cmdline/diff.sh
index a41a7e7..9193624 100755
--- a/regress/cmdline/diff.sh
+++ b/regress/cmdline/diff.sh
@@ -58,7 +58,7 @@ function test_diff_basic {
 	echo '+new file' >> $testroot/stdout.expected
 
 	(cd $testroot/wt && got diff > $testroot/stdout)
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -100,7 +100,7 @@ function test_diff_shows_conflict {
 
 	(cd $testroot/wt && got update > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -128,7 +128,7 @@ function test_diff_shows_conflict {
 
 	(cd $testroot/wt && got diff > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
diff --git a/regress/cmdline/log.sh b/regress/cmdline/log.sh
index a5272f0..11f0724 100755
--- a/regress/cmdline/log.sh
+++ b/regress/cmdline/log.sh
@@ -25,7 +25,7 @@ function test_log_in_repo {
 	for p in "" "." alpha epsilon epsilon/zeta; do
 		(cd $testroot/repo && got log $p | \
 			grep ^commit > $testroot/stdout)
-		cmp $testroot/stdout.expected $testroot/stdout
+		cmp -s $testroot/stdout.expected $testroot/stdout
 		ret="$?"
 		if [ "$ret" != "0" ]; then
 			diff -u $testroot/stdout.expected $testroot/stdout
@@ -37,7 +37,7 @@ function test_log_in_repo {
 	for p in "" "." zeta; do
 		(cd $testroot/repo/epsilon && got log $p | \
 			grep ^commit > $testroot/stdout)
-		cmp $testroot/stdout.expected $testroot/stdout
+		cmp -s $testroot/stdout.expected $testroot/stdout
 		ret="$?"
 		if [ "$ret" != "0" ]; then
 			diff -u $testroot/stdout.expected $testroot/stdout
@@ -58,7 +58,7 @@ function test_log_in_bare_repo {
 	for p in "" "." alpha epsilon epsilon/zeta; do
 		(cd $testroot/repo/.git && got log $p | \
 			grep ^commit > $testroot/stdout)
-		cmp $testroot/stdout.expected $testroot/stdout
+		cmp -s $testroot/stdout.expected $testroot/stdout
 		ret="$?"
 		if [ "$ret" != "0" ]; then
 			diff -u $testroot/stdout.expected $testroot/stdout
@@ -86,7 +86,7 @@ function test_log_in_worktree {
 	for p in "" "." alpha epsilon; do
 		(cd $testroot/wt && got log $p | \
 			grep ^commit > $testroot/stdout)
-		cmp $testroot/stdout.expected $testroot/stdout
+		cmp -s $testroot/stdout.expected $testroot/stdout
 		ret="$?"
 		if [ "$ret" != "0" ]; then
 			diff -u $testroot/stdout.expected $testroot/stdout
@@ -98,7 +98,7 @@ function test_log_in_worktree {
 	for p in "" "." zeta; do
 		(cd $testroot/wt/epsilon && got log $p | \
 			grep ^commit > $testroot/stdout)
-		cmp $testroot/stdout.expected $testroot/stdout
+		cmp -s $testroot/stdout.expected $testroot/stdout
 		ret="$?"
 		if [ "$ret" != "0" ]; then
 			diff -u $testroot/stdout.expected $testroot/stdout
diff --git a/regress/cmdline/revert.sh b/regress/cmdline/revert.sh
index 4c59fbd..584c34e 100755
--- a/regress/cmdline/revert.sh
+++ b/regress/cmdline/revert.sh
@@ -32,7 +32,7 @@ function test_revert_basic {
 
 	(cd $testroot/wt && got revert alpha > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -43,7 +43,7 @@ function test_revert_basic {
 	echo "alpha" > $testroot/content.expected
 	cat $testroot/wt/alpha > $testroot/content
 
-	cmp $testroot/content.expected $testroot/content
+	cmp -s $testroot/content.expected $testroot/content
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/content.expected $testroot/content
@@ -68,7 +68,7 @@ function test_revert_rm {
 
 	(cd $testroot/wt && got revert beta > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -79,7 +79,7 @@ function test_revert_rm {
 	echo "beta" > $testroot/content.expected
 	cat $testroot/wt/beta > $testroot/content
 
-	cmp $testroot/content.expected $testroot/content
+	cmp -s $testroot/content.expected $testroot/content
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/content.expected $testroot/content
@@ -104,7 +104,7 @@ function test_revert_add {
 
 	(cd $testroot/wt && got revert new > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -115,7 +115,7 @@ function test_revert_add {
 	echo "new file" > $testroot/content.expected
 	cat $testroot/wt/new > $testroot/content
 
-	cmp $testroot/content.expected $testroot/content
+	cmp -s $testroot/content.expected $testroot/content
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/content.expected $testroot/content
@@ -127,7 +127,7 @@ function test_revert_add {
 
 	(cd $testroot/wt && got status > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
diff --git a/regress/cmdline/rm.sh b/regress/cmdline/rm.sh
index e0f866b..bb717ca 100755
--- a/regress/cmdline/rm.sh
+++ b/regress/cmdline/rm.sh
@@ -29,7 +29,7 @@ function test_rm_basic {
 	echo 'D  beta' > $testroot/stdout.expected
 	(cd $testroot/wt && got rm beta > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -58,7 +58,7 @@ function test_rm_with_local_mods {
 	echo 'got: file contains modifications' > $testroot/stderr.expected
 	(cd $testroot/wt && got rm beta 2>$testroot/stderr)
 
-	cmp $testroot/stderr.expected $testroot/stderr
+	cmp -s $testroot/stderr.expected $testroot/stderr
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stderr.expected $testroot/stderr
@@ -69,7 +69,7 @@ function test_rm_with_local_mods {
 	echo 'D  beta' > $testroot/stdout.expected
 	(cd $testroot/wt && got rm -f beta > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
diff --git a/regress/cmdline/status.sh b/regress/cmdline/status.sh
index 6153d36..4829d1e 100755
--- a/regress/cmdline/status.sh
+++ b/regress/cmdline/status.sh
@@ -42,7 +42,7 @@ function test_status_basic {
 
 	(cd $testroot/wt && got status > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -76,7 +76,7 @@ function test_status_subdir_no_mods {
 	# ?  Basic/Targets.cpp
 	(cd $testroot/wt && got status > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -120,7 +120,7 @@ function test_status_subdir_no_mods2 {
 	# ?  Frontend/Rewrite/CMakeLists.txt
 	(cd $testroot/wt && got status > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -145,7 +145,7 @@ function test_status_obstructed {
 
 	(cd $testroot/wt && got status > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$?" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -187,7 +187,7 @@ function test_status_shows_local_mods_after_update {
 
 	(cd $testroot/wt && got update > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -199,7 +199,7 @@ function test_status_shows_local_mods_after_update {
 
 	(cd $testroot/wt && got status > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -247,7 +247,7 @@ function test_status_unversioned_subdirs {
 	# ?  ramdisk_cd/list.local
 	(cd $testroot/wt && got status > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -277,7 +277,7 @@ function test_status_ignores_symlink {
 
 	(cd $testroot/wt && got status > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -318,7 +318,7 @@ function test_status_shows_no_mods_after_complete_merge {
 
 	(cd $testroot/wt && got update > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -330,7 +330,7 @@ function test_status_shows_no_mods_after_complete_merge {
 
 	(cd $testroot/wt && got status > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -372,7 +372,7 @@ function test_status_shows_conflict {
 
 	(cd $testroot/wt && got update > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -384,7 +384,7 @@ function test_status_shows_conflict {
 
 	(cd $testroot/wt && got status > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
diff --git a/regress/cmdline/update.sh b/regress/cmdline/update.sh
index 00c8418..3c64295 100755
--- a/regress/cmdline/update.sh
+++ b/regress/cmdline/update.sh
@@ -36,7 +36,7 @@ function test_update_basic {
 
 	(cd $testroot/wt && got update > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -47,7 +47,7 @@ function test_update_basic {
 	echo "modified alpha" > $testroot/content.expected
 	cat $testroot/wt/alpha > $testroot/content
 
-	cmp $testroot/content.expected $testroot/content
+	cmp -s $testroot/content.expected $testroot/content
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/content.expected $testroot/content
@@ -76,7 +76,7 @@ function test_update_adds_file {
 
 	(cd $testroot/wt && got update > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -87,7 +87,7 @@ function test_update_adds_file {
 	echo "new" >> $testroot/content.expected
 	cat $testroot/wt/gamma/new > $testroot/content
 
-	cmp $testroot/content.expected $testroot/content
+	cmp -s $testroot/content.expected $testroot/content
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/content.expected $testroot/content
@@ -115,7 +115,7 @@ function test_update_deletes_file {
 
 	(cd $testroot/wt && got update > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -152,7 +152,7 @@ function test_update_deletes_dir {
 
 	(cd $testroot/wt && got update > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -192,7 +192,7 @@ function test_update_deletes_dir_with_path_prefix {
 
 	(cd $testroot/wt && got update -c $first_rev > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -235,7 +235,7 @@ function test_update_deletes_dir_recursively {
 
 	(cd $testroot/wt && got update -c $first_rev > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$?" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -277,7 +277,7 @@ function test_update_sibling_dirs_with_common_prefix {
 
 	(cd $testroot/wt && got update > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -299,7 +299,7 @@ function test_update_sibling_dirs_with_common_prefix {
 	# A  epsilon2/mu <--- not intended
 	(cd $testroot/wt && got update > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -307,7 +307,7 @@ function test_update_sibling_dirs_with_common_prefix {
 		return 1
 	fi
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -339,7 +339,7 @@ function test_update_dir_with_dot_sibling {
 
 	(cd $testroot/wt && got update > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -357,7 +357,7 @@ function test_update_dir_with_dot_sibling {
 
 	(cd $testroot/wt && got update > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -365,7 +365,7 @@ function test_update_dir_with_dot_sibling {
 		return 1
 	fi
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -404,7 +404,7 @@ function test_update_moves_files_upwards {
 
 	(cd $testroot/wt && got update > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -459,7 +459,7 @@ function test_update_moves_files_to_new_dir {
 
 	(cd $testroot/wt && got update > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -526,7 +526,7 @@ function test_update_creates_missing_parent {
 
 	(cd $testroot/wt && got update > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -578,7 +578,7 @@ function test_update_creates_missing_parent_with_subdir {
 
 	(cd $testroot/wt && got update > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -618,7 +618,7 @@ function test_update_file_in_subsubdir {
 
 	(cd $testroot/wt && got update > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -668,7 +668,7 @@ function test_update_merges_file_edits {
 
 	(cd $testroot/wt && got update > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -697,7 +697,7 @@ function test_update_merges_file_edits {
 	cat $testroot/wt/beta >> $testroot/content
 	cat $testroot/wt/numbers >> $testroot/content
 
-	cmp $testroot/content.expected $testroot/content
+	cmp -s $testroot/content.expected $testroot/content
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/content.expected $testroot/content
@@ -735,7 +735,7 @@ function test_update_keeps_xbit {
 		return 1
 	fi
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -793,7 +793,7 @@ function test_update_clears_xbit {
 		return 1
 	fi
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -828,7 +828,7 @@ function test_update_restores_missing_file {
 	echo >> $testroot/stdout.expected
 	(cd $testroot/wt && got update > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -840,7 +840,7 @@ function test_update_restores_missing_file {
 
 	cat $testroot/wt/alpha > $testroot/content
 
-	cmp $testroot/content.expected $testroot/content
+	cmp -s $testroot/content.expected $testroot/content
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/content.expected $testroot/content
@@ -871,7 +871,7 @@ function test_update_conflict_wt_add_vs_repo_add {
 	echo -n "Updated to commit " >> $testroot/stdout.expected
 	git_show_head $testroot/repo >> $testroot/stdout.expected
 	echo >> $testroot/stdout.expected
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -889,7 +889,7 @@ function test_update_conflict_wt_add_vs_repo_add {
 
 	cat $testroot/wt/gamma/new > $testroot/content
 
-	cmp $testroot/content.expected $testroot/content
+	cmp -s $testroot/content.expected $testroot/content
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/content.expected $testroot/content
@@ -901,7 +901,7 @@ function test_update_conflict_wt_add_vs_repo_add {
 	echo "new and also new" > $testroot/wt/gamma/new
 	echo 'M  gamma/new' > $testroot/stdout.expected
 	(cd $testroot/wt && got status > $testroot/stdout)
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -930,7 +930,7 @@ function test_update_conflict_wt_edit_vs_repo_rm {
 	echo -n "Updated to commit " >> $testroot/stdout.expected
 	git_show_head $testroot/repo >> $testroot/stdout.expected
 	echo >> $testroot/stdout.expected
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -942,7 +942,7 @@ function test_update_conflict_wt_edit_vs_repo_rm {
 
 	cat $testroot/wt/beta > $testroot/content
 
-	cmp $testroot/content.expected $testroot/content
+	cmp -s $testroot/content.expected $testroot/content
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/content.expected $testroot/content
@@ -953,7 +953,7 @@ function test_update_conflict_wt_edit_vs_repo_rm {
 	# beta is now an added file... we don't flag tree conflicts yet
 	echo 'A  beta' > $testroot/stdout.expected
 	(cd $testroot/wt && got status > $testroot/stdout)
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -982,7 +982,7 @@ function test_update_conflict_wt_rm_vs_repo_edit {
 	echo -n "Updated to commit " >> $testroot/stdout.expected
 	git_show_head $testroot/repo >> $testroot/stdout.expected
 	echo >> $testroot/stdout.expected
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -993,7 +993,7 @@ function test_update_conflict_wt_rm_vs_repo_edit {
 	# beta remains a deleted file... we don't flag tree conflicts yet
 	echo 'D  beta' > $testroot/stdout.expected
 	(cd $testroot/wt && got status > $testroot/stdout)
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -1014,7 +1014,7 @@ function test_update_conflict_wt_rm_vs_repo_edit {
 	echo '-modified beta' >> $testroot/stdout.expected
 
 	(cd $testroot/wt && got diff > $testroot/stdout)
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -1043,7 +1043,7 @@ function test_update_conflict_wt_rm_vs_repo_rm {
 	echo -n "Updated to commit " >> $testroot/stdout.expected
 	git_show_head $testroot/repo >> $testroot/stdout.expected
 	echo >> $testroot/stdout.expected
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -1054,7 +1054,7 @@ function test_update_conflict_wt_rm_vs_repo_rm {
 	# beta is now gone... we don't flag tree conflicts yet
 	echo 'got: bad path' > $testroot/stderr.expected
 	(cd $testroot/wt && got status beta 2> $testroot/stderr)
-	cmp $testroot/stderr.expected $testroot/stderr
+	cmp -s $testroot/stderr.expected $testroot/stderr
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stderr.expected $testroot/stderr
@@ -1094,7 +1094,7 @@ function test_update_partial {
 
 		(cd $testroot/wt && got update $f > $testroot/stdout)
 
-		cmp $testroot/stdout.expected $testroot/stdout
+		cmp -s $testroot/stdout.expected $testroot/stdout
 		ret="$?"
 		if [ "$ret" != "0" ]; then
 			diff -u $testroot/stdout.expected $testroot/stdout
@@ -1105,7 +1105,7 @@ function test_update_partial {
 		echo "modified $f" > $testroot/content.expected
 		cat $testroot/wt/$f > $testroot/content
 
-		cmp $testroot/content.expected $testroot/content
+		cmp -s $testroot/content.expected $testroot/content
 		ret="$?"
 		if [ "$ret" != "0" ]; then
 			diff -u $testroot/content.expected $testroot/content
@@ -1139,7 +1139,7 @@ function test_update_partial_add {
 
 		(cd $testroot/wt && got update $f > $testroot/stdout)
 
-		cmp $testroot/stdout.expected $testroot/stdout
+		cmp -s $testroot/stdout.expected $testroot/stdout
 		ret="$?"
 		if [ "$ret" != "0" ]; then
 			diff -u $testroot/stdout.expected $testroot/stdout
@@ -1150,7 +1150,7 @@ function test_update_partial_add {
 		echo "$f" > $testroot/content.expected
 		cat $testroot/wt/$f > $testroot/content
 
-		cmp $testroot/content.expected $testroot/content
+		cmp -s $testroot/content.expected $testroot/content
 		ret="$?"
 		if [ "$ret" != "0" ]; then
 			diff -u $testroot/content.expected $testroot/content
@@ -1187,7 +1187,7 @@ function test_update_partial_rm {
 			return 1
 		fi
 
-		cmp $testroot/stderr.expected $testroot/stderr
+		cmp -s $testroot/stderr.expected $testroot/stderr
 		ret="$?"
 		if [ "$ret" != "0" ]; then
 			diff -u $testroot/stderr.expected $testroot/stderr
@@ -1220,7 +1220,7 @@ function test_update_partial_dir {
 
 	(cd $testroot/wt && got update epsilon > $testroot/stdout)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -1231,7 +1231,7 @@ function test_update_partial_dir {
 	echo "modified epsilon/zeta" > $testroot/content.expected
 	cat $testroot/wt/epsilon/zeta > $testroot/content
 
-	cmp $testroot/content.expected $testroot/content
+	cmp -s $testroot/content.expected $testroot/content
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/content.expected $testroot/content
@@ -1268,7 +1268,7 @@ function test_update_moved_branch_ref {
 
 	(cd $testroot/wt && got update > $testroot/stdout 2> $testroot/stderr)
 
-	cmp $testroot/stdout.expected $testroot/stdout
+	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stdout.expected $testroot/stdout
@@ -1276,7 +1276,7 @@ function test_update_moved_branch_ref {
 		return 1
 	fi
 
-	cmp $testroot/stderr.expected $testroot/stderr
+	cmp -s $testroot/stderr.expected $testroot/stderr
 	ret="$?"
 	if [ "$ret" != "0" ]; then
 		diff -u $testroot/stderr.expected $testroot/stderr