From a944af1d86e6171d68ed2a3aa67b1d68f00e1fe8 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 8 Sep 2012 21:27:19 -0700 Subject: 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 --- t/t6037-merge-ours-theirs.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 't') 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 && -- cgit v1.2.1