git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
To: Junio C Hamano <gitster@pobox.com>
Cc: GIT Mailing-list <git@vger.kernel.org>, sunshine@sunshineco.com
Subject: [PATCH 11/14] t3032-*.sh: Pass the -b (--binary) option to sed on cygwin
Date: Tue, 14 Dec 2010 18:34:29 +0000	[thread overview]
Message-ID: <4D07B8B5.2030409@ramsay1.demon.co.uk> (raw)


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>
---

Note that this test does not fail on MinGW, but I don't
really know why, given commit ca02ad3... ahem ;-)

 t/t3032-merge-recursive-options.sh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/t/t3032-merge-recursive-options.sh b/t/t3032-merge-recursive-options.sh
index 2293797..f70f6c4 100755
--- a/t/t3032-merge-recursive-options.sh
+++ b/t/t3032-merge-recursive-options.sh
@@ -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
-- 
1.7.3

             reply	other threads:[~2010-12-14 18:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-14 18:34 Ramsay Jones [this message]
2010-12-14 19:24 ` [PATCH 11/14] t3032-*.sh: Pass the -b (--binary) option to sed on cygwin Junio C Hamano
2010-12-14 23:32   ` Eric Sunshine
2010-12-15  8:22     ` Johannes Sixt
2010-12-15  9:30       ` Eric Sunshine
2010-12-16 21:19         ` Ramsay Jones
2010-12-17  7:34           ` Johannes Sixt
2010-12-18 20:16             ` Ramsay Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D07B8B5.2030409@ramsay1.demon.co.uk \
    --to=ramsay@ramsay1.demon.co.uk \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).