Skip to content

Commit

Permalink
t3032-*.sh: Pass the -b (--binary) option to sed on cygwin
Browse files Browse the repository at this point in the history
The test using the conflict_hunks helper function (test 9) fails
on cygwin, since sed (by default) throws away the CR from CRLF
line endings. This behaviour is undesirable, since the validation
code expects the CRLF line-ending to be present. In order to fix
the problem we pass the -b (--binary) option to sed, using the
SED_OPTIONS variable. We use the SED_STRIPS_CR prerequisite in the
conditional initialisation of SED_OPTIONS.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Ramsay Jones authored and Junio C Hamano committed Jan 9, 2011
1 parent a31d066 commit 906a9a7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion t/t3032-merge-recursive-options.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ test_description='merge-recursive options

. ./test-lib.sh

test_have_prereq SED_STRIPS_CR && SED_OPTIONS=-b

test_expect_success 'setup' '
conflict_hunks () {
sed -n -e "
sed $SED_OPTIONS -n -e "
/^<<<</ b inconflict
b
: inconflict
Expand Down

0 comments on commit 906a9a7

Please sign in to comment.