Merge branch 'lw/daemon-log-destination'
[git] / t / t6033-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 . ./test-lib.sh
12
13 test_expect_success setup '
14         git config core.autocrlf true &&
15         echo foo | append_cr >file &&
16         git add file &&
17         git commit -m "Initial" &&
18         git tag initial &&
19         git branch side &&
20         echo line from a | append_cr >file &&
21         git commit -m "add line from a" file &&
22         git tag a &&
23         git checkout side &&
24         echo line from b | append_cr >file &&
25         git commit -m "add line from b" file &&
26         git tag b &&
27         git checkout master
28 '
29
30 test_expect_success 'Check "ours" is CRLF' '
31         git reset --hard initial &&
32         git merge side -s ours &&
33         cat file | remove_cr | append_cr >file.temp &&
34         test_cmp file file.temp
35 '
36
37 test_expect_success 'Check that conflict file is CRLF' '
38         git reset --hard a &&
39         test_must_fail git merge side &&
40         cat file | remove_cr | append_cr >file.temp &&
41         test_cmp file file.temp
42 '
43
44 test_done