diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-10-21 01:23:10 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-10-21 01:23:11 +0200 |
commit | c662038629a5fb9b604df0f4ae5d812799de52fe (patch) | |
tree | 9bdc3c1b4feaa0050d7257565bae8defa1a7bcc4 /t | |
parent | The nineteenth batch (diff) | |
parent | merge: introduce {copy|clear}_merge_options() (diff) | |
download | git-c662038629a5fb9b604df0f4ae5d812799de52fe.tar.xz git-c662038629a5fb9b604df0f4ae5d812799de52fe.zip |
Merge branch 'ty/merge-tree-strategy-options'
"git merge-tree" learned to take strategy backend specific options
via the "-X" option, like "git merge" does.
* ty/merge-tree-strategy-options:
merge: introduce {copy|clear}_merge_options()
merge-tree: add -X strategy option
Diffstat (limited to 't')
-rwxr-xr-x | t/t4301-merge-tree-write-tree.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/t/t4301-merge-tree-write-tree.sh b/t/t4301-merge-tree-write-tree.sh index 250f721795..b2c8a43fce 100755 --- a/t/t4301-merge-tree-write-tree.sh +++ b/t/t4301-merge-tree-write-tree.sh @@ -22,6 +22,7 @@ test_expect_success setup ' git branch side1 && git branch side2 && git branch side3 && + git branch side4 && git checkout side1 && test_write_lines 1 2 3 4 5 6 >numbers && @@ -46,6 +47,13 @@ test_expect_success setup ' test_tick && git commit -m rename-numbers && + git checkout side4 && + test_write_lines 0 1 2 3 4 5 >numbers && + echo yo >greeting && + git add numbers greeting && + test_tick && + git commit -m other-content-modifications && + git switch --orphan unrelated && >something-else && git add something-else && @@ -97,6 +105,21 @@ test_expect_success 'Content merge and a few conflicts' ' test_cmp expect actual ' +test_expect_success 'Auto resolve conflicts by "ours" strategy option' ' + git checkout side1^0 && + + # make sure merge conflict exists + test_must_fail git merge side4 && + git merge --abort && + + git merge -X ours side4 && + git rev-parse HEAD^{tree} >expected && + + git merge-tree -X ours side1 side4 >actual && + + test_cmp expected actual +' + test_expect_success 'Barf on misspelled option, with exit code other than 0 or 1' ' # Mis-spell with single "s" instead of double "s" test_expect_code 129 git merge-tree --write-tree --mesages FOOBAR side1 side2 2>expect && |