[PATCH v1 4/7] test: add various tests for diff formats with -s

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

 



There used to be a bug when -s was used with different formats, for
example `-s --raw`.

Originally-by: Junio C Hamano <gitster@xxxxxxxxx>
Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>
---
 t/t4000-diff-format.sh | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/t/t4000-diff-format.sh b/t/t4000-diff-format.sh
index bfcaae390f..7829cc810d 100755
--- a/t/t4000-diff-format.sh
+++ b/t/t4000-diff-format.sh
@@ -91,4 +91,23 @@ test_expect_success 'git diff-files --patch --no-patch does not show the patch'
 	test_must_be_empty err
 '
 
+
+echo 'reset' >path1
+
+for format in stat raw numstat shortstat summary dirstat cumulative \
+	dirstat-by-file patch-with-raw patch-with-stat compact-summary
+do
+	test_expect_success "-s before --$format' is a no-op" '
+		git diff-files -s "--$format" >actual &&
+		git diff-files "--$format" >expect &&
+		test_cmp expect actual
+	'
+
+	test_expect_success "-s clears --$format" '
+		git diff-files --$format -s --patch >actual &&
+		git diff-files --patch >expect &&
+		test_cmp expect actual
+	'
+done
+
 test_done
-- 
2.40.0+fc1




[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