]> git.ipfire.org Git - thirdparty/git.git/blob - t/t6413-merge-crlf.sh
Merge branch 'jb/reflog-expire-delete-dry-run-options' into maint-2.43
[thirdparty/git.git] / t / t6413-merge-crlf.sh
1 #!/bin/sh
2
3 test_description='merge conflict in crlf repo
4
5 b---M
6 / /
7 initial---a
8
9 '
10
11 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
12 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
13
14 TEST_PASSES_SANITIZE_LEAK=true
15 . ./test-lib.sh
16
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
32 '
33
34 test_expect_success 'Check "ours" is CRLF' '
35 git reset --hard initial &&
36 git merge side -s ours &&
37 cat file | remove_cr | append_cr >file.temp &&
38 test_cmp file file.temp
39 '
40
41 test_expect_success 'Check that conflict file is CRLF' '
42 git reset --hard a &&
43 test_must_fail git merge side &&
44 cat file | remove_cr | append_cr >file.temp &&
45 test_cmp file file.temp
46 '
47
48 test_done