Skip to content

Commit 4f96fcc

Browse files
weynhamzpeff
authored andcommitted
contrib/subtree: Add merge tests
Add some tests for various merge operations. Test combinations of merge with --message, --prefix and --squash. Signed-off-by: Techlive Zheng <[email protected]> Signed-off-by: David A. Greene <[email protected]> Signed-off-by: Jeff King <[email protected]>
1 parent c992499 commit 4f96fcc

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

contrib/subtree/t/t7900-subtree.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,22 @@ test_expect_success 'check if --message for merge works with squash too' '
210210

211211
test_expect_success 'merge new subproj history into subdir' '
212212
git subtree merge --prefix="sub dir" FETCH_HEAD &&
213-
git branch pre-split &&
214213
check_equal ''"$(last_commit_message)"'' "Merge commit '"'"'"$(git rev-parse sub2)"'"'"' into mainline" &&
215214
undo
216215
'
217216

217+
test_expect_success 'merge new subproj history into subdir/ with --prefix and --message' '
218+
git subtree merge --prefix="sub dir" --message="Merged changes from subproject" FETCH_HEAD &&
219+
check_equal "$(last_commit_message)" "Merged changes from subproject" &&
220+
undo
221+
'
222+
223+
test_expect_success 'merge new subproj history into subdir/ with --squash and --prefix and --message' '
224+
git subtree merge --prefix="sub dir" --message="Merged changes from subproject using squash" --squash FETCH_HEAD &&
225+
check_equal "$(last_commit_message)" "Merged changes from subproject using squash" &&
226+
undo
227+
'
228+
218229
test_expect_success 'split requires option --prefix' '
219230
echo "You must provide the --prefix option." > expected &&
220231
test_must_fail git subtree split > actual 2>&1 &&

0 commit comments

Comments
 (0)