[PATCH 2/5] Add test for cherry-pick --skip-redundant-commits

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

 



From: "David A. Greene" <greened@xxxxxxxxxxxxx>

Test that --skip-redundant commits suppresses an abort when
cherry-picking a redundant commit.

Signed-off-by: David A. Greene <greened@xxxxxxxxxxxxx>
---
 t/t3514-cherry-pick-redundant.sh | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100755 t/t3514-cherry-pick-redundant.sh

diff --git a/t/t3514-cherry-pick-redundant.sh b/t/t3514-cherry-pick-redundant.sh
new file mode 100755
index 0000000..c433344
--- /dev/null
+++ b/t/t3514-cherry-pick-redundant.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+test_description='git cherry-pick tests for redundant commits
+
+This test runs git cherry-pick and tests handling of redundant commits.
+'
+. ./test-lib.sh
+
+test_expect_success 'setup' '
+	test_commit one &&
+	test_commit two &&
+	test_commit three
+'
+
+test_expect_success 'cherry-pick redundant commit fails' '
+	git branch test-start &&
+	git reset --hard HEAD~2 &&
+	git cherry-pick test-start &&
+	test_must_fail git cherry-pick test-start
+'
+
+test_expect_success 'cherry-pick with --skip-redundant-commits' '
+	git cherry-pick --skip-redundant-commits test-start
+'
+
+test_done
-- 
2.6.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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]