[PATCH 4/7] contrib/subtree: Add merge tests

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

 



From: Techlive Zheng <techlivezheng@xxxxxxxxx>

Add some tests for various merge operations.  Test combinations of merge
with --message, --prefix and --squash.

Signed-off-by: Techlive Zheng <techlivezheng@xxxxxxxxx>
Signed-off-by: David A. Greene <greened@xxxxxxxxxxxxx>
---
 contrib/subtree/t/t7900-subtree.sh | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh
index 1fa5991..7d59a1a 100755
--- a/contrib/subtree/t/t7900-subtree.sh
+++ b/contrib/subtree/t/t7900-subtree.sh
@@ -210,11 +210,22 @@ test_expect_success 'check if --message for merge works with squash too' '
 
 test_expect_success 'merge new subproj history into subdir' '
 	git subtree merge --prefix="sub dir" FETCH_HEAD &&
-	git branch pre-split &&
 	check_equal ''"$(last_commit_message)"'' "Merge commit '"'"'"$(git rev-parse sub2)"'"'"' into mainline" &&
 	undo
 '
 
+test_expect_success 'merge new subproj history into subdir/ with --prefix and --message' '
+	git subtree merge --prefix="sub dir" --message="Merged changes from subproject" FETCH_HEAD &&
+	check_equal "$(last_commit_message)" "Merged changes from subproject" &&
+	undo
+'
+
+test_expect_success 'merge new subproj history into subdir/ with --squash and --prefix and --message' '
+	git subtree merge --prefix="sub dir" --message="Merged changes from subproject using squash" --squash FETCH_HEAD &&
+	check_equal "$(last_commit_message)" "Merged changes from subproject using squash" &&
+	undo
+'
+
 test_expect_success 'split requires option --prefix' '
 	echo "You must provide the --prefix option." > expected &&
 	test_must_fail git subtree split > actual 2>&1 &&
-- 
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]