[PATCH] fixup! t: teach test_cmp_rev to accept ! for not-equals

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Denton Liu <liu.denton@xxxxxxxxx>
---
Thanks for the suggestion, Junio. Since it's just a minor cleanup,
here's the fixup patch for it.

 t/test-lib-functions.sh | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index 01cdbb0478..15f4c96777 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -1016,11 +1016,13 @@ test_must_be_empty () {
 # provided first, that its other two parameters refer to different
 # revisions.
 test_cmp_rev () {
-	local op
+	local op wrong_result
 	op='='
+	wrong_result='different'
 	if test $# -ge 1 && test "x$1" = 'x!'
 	then
 	    op='!='
+	    wrong_result='the same'
 	    shift
 	fi
 	if test $# != 2
@@ -1033,15 +1035,8 @@ test_cmp_rev () {
 
 		if ! test "$r1" "$op" "$r2"
 		then
-			local comp_out
-			if "x$op" = 'x='
-			then
-				comp_out='different'
-			else
-				comp_out='the same'
-			fi
 			cat >&4 <<-EOF
-			error: two revisions point to $comp_out objects:
+			error: two revisions point to $wrong_result objects:
 			  '$1': $r1
 			  '$2': $r2
 			EOF
-- 
2.24.0.300.g722ba42680




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux