git/list[1] front-page[2] threads[3] people[4] search[5] about
 

RE: [PATCH v2] am: ignore leading whitespace before patch

From
David Barr <davidbarr@google.com>
Date
Aug 8, 2011, 05:10 UTC
Message-ID
<1312780242-91659-1-git-send-email-davidbarr@google.com>
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
Previous: Jonathan NiederNext: David Barr
Message 9 of 10 in “git-am: ignore leading whitespace before patch”
  1. git-am: ignore leading whitespace before patchDavid Barr, Aug 2, 2011
  2. Tay Ray ChuanAug 3, 2011
  3. Sverre RabbelierAug 3, 2011
  4. Tay Ray ChuanAug 3, 2011
  5. Sverre RabbelierAug 3, 2011
  6. David BarrAug 6, 2011
  7. Junio C HamanoAug 6, 2011
  8. am: ignore leading whitespace before patchJonathan Nieder, Aug 8, 2011
  9. David BarrAug 8, 2011
  10. David BarrAug 8, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.