]> git.ipfire.org Git - thirdparty/git.git/blame - t/t6413-merge-crlf.sh
The third batch
[thirdparty/git.git] / t / t6413-merge-crlf.sh
CommitLineData
eea98284
MSO
1#!/bin/sh
2
eea98284
MSO
3test_description='merge conflict in crlf repo
4
5 b---M
6 / /
7 initial---a
8
9'
10
5902f5f4 11GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
334afbc7
JS
12export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
13
3e3b9321 14TEST_PASSES_SANITIZE_LEAK=true
eea98284
MSO
15. ./test-lib.sh
16
17test_expect_success setup '
18 git config core.autocrlf true &&
19 echo foo | append_cr >file &&
20 git add file &&
21 git commit -m "Initial" &&
22 git tag initial &&
23 git branch side &&
24 echo line from a | append_cr >file &&
25 git commit -m "add line from a" file &&
26 git tag a &&
27 git checkout side &&
28 echo line from b | append_cr >file &&
29 git commit -m "add line from b" file &&
30 git tag b &&
5902f5f4 31 git checkout main
eea98284
MSO
32'
33
34test_expect_success 'Check "ours" is CRLF' '
35 git reset --hard initial &&
36 git merge side -s ours &&
edfa63e7 37 remove_cr <file | append_cr >file.temp &&
eea98284
MSO
38 test_cmp file file.temp
39'
40
249c61a6 41test_expect_success 'Check that conflict file is CRLF' '
eea98284
MSO
42 git reset --hard a &&
43 test_must_fail git merge side &&
edfa63e7 44 remove_cr <file | append_cr >file.temp &&
eea98284
MSO
45 test_cmp file file.temp
46'
47
48test_done