[PATCH 6/9] t4013: add tests for log.diffMerges config

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

 



Test that wrong values are denied.

Test that the value of log.diffMerges properly affects both
--diff-merges=def and -m.

Signed-off-by: Sergey Organov <sorganov@xxxxxxxxx>
---
 t/t4013-diff-various.sh | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh
index 275a6790896d..ee4afca06ced 100755
--- a/t/t4013-diff-various.sh
+++ b/t/t4013-diff-various.sh
@@ -460,6 +460,32 @@ test_expect_success 'log --diff-merges=def matches --diff-merges=separate' '
 	test_cmp expected actual
 '
 
+test_expect_success 'deny wrong log.diffMerges config' '
+	git config log.diffMerges wrong-value &&
+	test_expect_code 128 git log &&
+	git config --unset log.diffMerges
+'
+
+test_expect_success 'git config log.diffMerges first-parent' '
+	git log -p --diff-merges=first-parent master >result &&
+	process_diffs result >expected &&
+	git config log.diffMerges first-parent &&
+	git log -p --diff-merges=def master >result &&
+	process_diffs result >actual &&
+	git config --unset log.diffMerges &&
+	test_cmp expected actual
+'
+
+test_expect_success 'git config log.diffMerges first-parent vs -m' '
+	git log -p --diff-merges=first-parent master >result &&
+	process_diffs result >expected &&
+	git config log.diffMerges first-parent &&
+	git log -p -m master >result &&
+	process_diffs result >actual &&
+	git config --unset log.diffMerges &&
+	test_cmp expected actual
+'
+
 test_expect_success 'log -S requires an argument' '
 	test_must_fail git log -S
 '
-- 
2.25.1




[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