aboutsummaryrefslogtreecommitdiff
path: root/t/t6037-merge-ours-theirs.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-09-08 21:27:19 -0700
committerJunio C Hamano <gitster@pobox.com>2012-09-08 21:27:19 -0700
commita944af1d86e6171d68ed2a3aa67b1d68f00e1fe8 (patch)
tree7f351a1a1d9d7f01cc7195a527eab88417789417 /t/t6037-merge-ours-theirs.sh
parentd0f1ea6003d97e63110fa7d50bb07f546a909b6e (diff)
downloadgit-a944af1d86e6171d68ed2a3aa67b1d68f00e1fe8.tar.gz
git-a944af1d86e6171d68ed2a3aa67b1d68f00e1fe8.tar.xz
merge: teach -Xours/-Xtheirs to binary ll-merge driver
The (discouraged) -Xours/-Xtheirs modes of merge are supposed to give a quick and dirty way to come up with a random mixture of cleanly merged parts and punted conflict resolution to take contents from one side in conflicting parts. These options however were only passed down to the low level merge driver for text. Teach the built-in binary merge driver to notice them as well. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6037-merge-ours-theirs.sh')
-rwxr-xr-xt/t6037-merge-ours-theirs.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/t/t6037-merge-ours-theirs.sh b/t/t6037-merge-ours-theirs.sh
index 2cf42c73f..8d0567141 100755
--- a/t/t6037-merge-ours-theirs.sh
+++ b/t/t6037-merge-ours-theirs.sh
@@ -53,7 +53,19 @@ test_expect_success 'recursive favouring ours' '
! grep 1 file
'
-test_expect_success 'pull with -X' '
+test_expect_success 'binary file with -Xours/-Xtheirs' '
+ echo "file -merge" >.gitattributes &&
+
+ git reset --hard master &&
+ git merge -s recursive -X theirs side &&
+ git diff --exit-code side HEAD -- file &&
+
+ git reset --hard master &&
+ git merge -s recursive -X ours side &&
+ git diff --exit-code master HEAD -- file
+'
+
+test_expect_success 'pull passes -X to underlying merge' '
git reset --hard master && git pull -s recursive -Xours . side &&
git reset --hard master && git pull -s recursive -X ours . side &&
git reset --hard master && git pull -s recursive -Xtheirs . side &&