summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2016-01-27 17:37:40 +0100
committerJunio C Hamano <gitster@pobox.com>2016-01-27 10:21:53 -0800
commit15980deab9f41324aba5cc9536e463d204bafe63 (patch)
tree2d0d00313010c98c5d1fd96d4dacc655c23aa4af /t
parent86efa215276aaeaef0c556c73f1993b6f36dcf91 (diff)
downloadgit-15980deab9f41324aba5cc9536e463d204bafe63.tar.gz
merge-file: ensure that conflict sections match eol stylejs/xmerge-marker-eol
In the previous patch, we made sure that the conflict markers themselves match the end-of-line style of the input files. However, this still left out the conflicting text itself: if it lacks a trailing newline, we add one, and should add a carriage return when appropriate, too. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t6023-merge-file.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/t/t6023-merge-file.sh b/t/t6023-merge-file.sh
index a082116501..20aee43f95 100755
--- a/t/t6023-merge-file.sh
+++ b/t/t6023-merge-file.sh
@@ -346,13 +346,14 @@ test_expect_success 'conflict at EOF without LF resolved by --union' \
printf "line1\nline2\nline3x\nline3y" >expect.txt &&
test_cmp expect.txt output.txt'
-test_expect_success 'conflict markers match existing line endings' '
+test_expect_success 'conflict sections match existing line endings' '
printf "1\\r\\n2\\r\\n3" >crlf-orig.txt &&
printf "1\\r\\n2\\r\\n4" >crlf-diff1.txt &&
printf "1\\r\\n2\\r\\n5" >crlf-diff2.txt &&
test_must_fail git -c core.eol=crlf merge-file -p \
crlf-diff1.txt crlf-orig.txt crlf-diff2.txt >crlf.txt &&
test $(tr "\015" Q <crlf.txt | grep "^[<=>].*Q$" | wc -l) = 3 &&
+ test $(tr "\015" Q <crlf.txt | grep "[345]Q$" | wc -l) = 3 &&
test_must_fail git -c core.eol=crlf merge-file -p \
nolf-diff1.txt nolf-orig.txt nolf-diff2.txt >nolf.txt &&
test $(tr "\015" Q <nolf.txt | grep "^[<=>].*Q$" | wc -l) = 0