interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / t / t6413-merge-crlf.sh

47 lines · 978 bytes Raw Blame History
1#!/bin/sh
2
3test_description='merge conflict in crlf repo
4
5 b---M
6 / /
7 initial---a
8
9'
10
11GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
12export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
13
14. ./test-lib.sh
15
16test_expect_success setup '
17 git config core.autocrlf true &&
18 echo foo | append_cr >file &&
19 git add file &&
20 git commit -m "Initial" &&
21 git tag initial &&
22 git branch side &&
23 echo line from a | append_cr >file &&
24 git commit -m "add line from a" file &&
25 git tag a &&
26 git checkout side &&
27 echo line from b | append_cr >file &&
28 git commit -m "add line from b" file &&
29 git tag b &&
30 git checkout main
31'
32
33test_expect_success 'Check "ours" is CRLF' '
34 git reset --hard initial &&
35 git merge side -s ours &&
36 remove_cr <file | append_cr >file.temp &&
37 test_cmp file file.temp
38'
39
40test_expect_success 'Check that conflict file is CRLF' '
41 git reset --hard a &&
42 test_must_fail git merge side &&
43 remove_cr <file | append_cr >file.temp &&
44 test_cmp file file.temp
45'
46
47test_done