]>
Commit | Line | Data |
---|---|---|
eea98284 MSO |
1 | #!/bin/sh |
2 | ||
eea98284 MSO |
3 | test_description='merge conflict in crlf repo |
4 | ||
5 | b---M | |
6 | / / | |
7 | initial---a | |
8 | ||
9 | ' | |
10 | ||
5902f5f4 | 11 | GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main |
334afbc7 JS |
12 | export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME |
13 | ||
3e3b9321 | 14 | TEST_PASSES_SANITIZE_LEAK=true |
eea98284 MSO |
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 && | |
5902f5f4 | 31 | git checkout main |
eea98284 MSO |
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 | ||
249c61a6 | 41 | test_expect_success 'Check that conflict file is CRLF' ' |
eea98284 MSO |
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 |