summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-02-17 18:03:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-02-17 18:03:39 (GMT)
commitab2c107eab77a7879574992752a3ac96421bef34 (patch)
treeeb323695cedf7ce04545e0331b885dc17fa5e2ab /t
parent527d4a638e330f4efe459442bbfb0799d29fd73a (diff)
parent15980deab9f41324aba5cc9536e463d204bafe63 (diff)
downloadgit-ab2c107eab77a7879574992752a3ac96421bef34.zip
git-ab2c107eab77a7879574992752a3ac96421bef34.tar.gz
git-ab2c107eab77a7879574992752a3ac96421bef34.tar.bz2
Merge branch 'js/xmerge-marker-eol' into maint
The low-level merge machinery has been taught to use CRLF line termination when inserting conflict markers to merged contents that are themselves CRLF line-terminated. * js/xmerge-marker-eol: merge-file: ensure that conflict sections match eol style merge-file: let conflict markers match end-of-line style of the context
Diffstat (limited to 't')
-rwxr-xr-xt/t6023-merge-file.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t6023-merge-file.sh b/t/t6023-merge-file.sh
index 190ee90..20aee43 100755
--- a/t/t6023-merge-file.sh
+++ b/t/t6023-merge-file.sh
@@ -346,4 +346,17 @@ 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 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
+'
+
test_done