git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Barr <davidbarr@google.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: David Barr <davidbarr@google.com>,
	Jonathan Nieder <jrnieder@gmail.com>,
	Git Mailing List <git@vger.kernel.org>,
	Tay Ray Chuan <rctay89@gmail.com>,
	Sverre Rabbelier <srabbelier@gmail.com>,
	Giuseppe Bilotta <giuseppe.bilotta@gmail.com>,
	Simon Sasburg <simon.sasburg@gmail.com>
Subject: RE: [PATCH v2] am: ignore leading whitespace before patch
Date: Mon,  8 Aug 2011 15:10:42 +1000	[thread overview]
Message-ID: <1312780242-91659-1-git-send-email-davidbarr@google.com> (raw)
In-Reply-To: <20110808024904.GF19551@elie.gateway.2wire.net>

Add a test for GMail-style padded email files.

Signed-off-by: David Barr <davidbarr@google.com>
---
 t/t4150-am.sh |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index 151404e..40a5a3e 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -167,6 +167,17 @@ test_expect_success 'am applies patch e-mail not in a mbox with CRLF' '
 	test "$(git rev-parse second^)" = "$(git rev-parse HEAD^)"
 '
 
+test_expect_success 'am applies patch e-mail with preceding whitespace' '
+	rm -fr .git/rebase-apply &&
+	git reset --hard &&
+	git checkout first &&
+	printf "%256s\\n" "" >patch1-ws.eml &&
+	cat patch1.eml >>patch1-ws.eml &&
+	git am <patch1-ws.eml >output.out 2>&1 &&
+	! test -d .git/rebase-apply &&
+	git diff --exit-code second
+'
+
 test_expect_success 'setup: new author and committer' '
 	GIT_AUTHOR_NAME="Another Thor" &&
 	GIT_AUTHOR_EMAIL="a.thor@example.com" &&
-- 
1.7.6

  parent reply	other threads:[~2011-08-08  5:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-02 22:20 [PATCH] git-am: ignore leading whitespace before patch David Barr
2011-08-03 12:28 ` Tay Ray Chuan
2011-08-03 13:21   ` Sverre Rabbelier
2011-08-03 13:31     ` Tay Ray Chuan
2011-08-03 13:33       ` Sverre Rabbelier
2011-08-06  1:56   ` David Barr
2011-08-06  5:00     ` Junio C Hamano
2011-08-08  2:49       ` [PATCH v2] am: " Jonathan Nieder
2011-08-08  5:10 ` David Barr [this message]
2011-08-08  5:31   ` David Barr

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=1312780242-91659-1-git-send-email-davidbarr@google.com \
    --to=davidbarr@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=giuseppe.bilotta@gmail.com \
    --cc=jrnieder@gmail.com \
    --cc=rctay89@gmail.com \
    --cc=simon.sasburg@gmail.com \
    --cc=srabbelier@gmail.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).