#!/bin/sh global test_description := ''merge conflict in crlf repo b---M / / initial---a '' source ./test-lib.sh test_expect_success setup ' git config core.autocrlf true && echo foo | append_cr >file && git add file && git commit -m "Initial" && git tag initial && git branch side && echo line from a | append_cr >file && git commit -m "add line from a" file && git tag a && git checkout side && echo line from b | append_cr >file && git commit -m "add line from b" file && git tag b && git checkout master ' test_expect_success 'Check "ours" is CRLF' ' git reset --hard initial && git merge side -s ours && cat file | remove_cr | append_cr >file.temp && test_cmp file file.temp ' test_expect_success 'Check that conflict file is CRLF' ' git reset --hard a && test_must_fail git merge side && cat file | remove_cr | append_cr >file.temp && test_cmp file file.temp ' test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: { (SQ <"merge conflict in crlf repo\n"> <"\n"> <"\t\tb---M\n"> <"\t / /\n"> <"\tinitial---a\n"> <"\n"> ) } spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(setup)} { (SQ <"\n"> <"\tgit config core.autocrlf true &&\n"> <"\techo foo | append_cr >file &&\n"> <"\tgit add file &&\n"> <"\tgit commit -m \"Initial\" &&\n"> <"\tgit tag initial &&\n"> <"\tgit branch side &&\n"> <"\techo line from a | append_cr >file &&\n"> <"\tgit commit -m \"add line from a\" file &&\n"> <"\tgit tag a &&\n"> <"\tgit checkout side &&\n"> <"\techo line from b | append_cr >file &&\n"> <"\tgit commit -m \"add line from b\" file &&\n"> <"\tgit tag b &&\n"> <"\tgit checkout master\n"> ) } ) (C {(test_expect_success)} {(SQ <"Check \"ours\" is CRLF">)} { (SQ <"\n"> <"\tgit reset --hard initial &&\n"> <"\tgit merge side -s ours &&\n"> <"\tcat file | remove_cr | append_cr >file.temp &&\n"> <"\ttest_cmp file file.temp\n"> ) } ) (C {(test_expect_success)} {(SQ <"Check that conflict file is CRLF">)} { (SQ <"\n"> <"\tgit reset --hard a &&\n"> <"\ttest_must_fail git merge side &&\n"> <"\tcat file | remove_cr | append_cr >file.temp &&\n"> <"\ttest_cmp file file.temp\n"> ) } ) (C {(test_done)}) ] )