Revision 1cdc62f6f16e6dae4343824f08286015c8c4b9c2 authored by Jeff King on 06 February 2018, 08:43:19 UTC, committed by Junio C Hamano on 08 February 2018, 18:07:51 UTC
We check that a shell variable is non-empty, and then we
check that it's equal to a particular value. Just checking
the latter covers both cases.

I suspect the original was trying to give better output when
the test fails, but using "-x" covers that these days.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 8279ed0
Raw File
t6033-merge-crlf.sh
#!/bin/sh

test_description='merge conflict in crlf repo

		b---M
	       /   /
	initial---a

'

. ./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
back to top