Git 2.45
[git/gitster.git] / t / t6413-merge-crlf.sh
blob647ea1e8382913887e292977502181b223136b46
1 #!/bin/sh
3 test_description='merge conflict in crlf repo
5 b---M
6 / /
7 initial---a
11 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
12 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
14 TEST_PASSES_SANITIZE_LEAK=true
15 . ./test-lib.sh
17 test_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 &&
31 git checkout main
34 test_expect_success 'Check "ours" is CRLF' '
35 git reset --hard initial &&
36 git merge side -s ours &&
37 remove_cr <file | append_cr >file.temp &&
38 test_cmp file file.temp
41 test_expect_success 'Check that conflict file is CRLF' '
42 git reset --hard a &&
43 test_must_fail git merge side &&
44 remove_cr <file | append_cr >file.temp &&
45 test_cmp file file.temp
48 test_done