git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Packham <judge.packham@gmail.com>
To: git@vger.kernel.org
Cc: Chris Packham <judge.packham@gmail.com>
Subject: [RFC PATCHv3 2/4] t/am: add test for stgit patch format
Date: Fri,  5 Sep 2014 22:06:49 +1200	[thread overview]
Message-ID: <1409911611-20370-3-git-send-email-judge.packham@gmail.com> (raw)
In-Reply-To: <1409911611-20370-1-git-send-email-judge.packham@gmail.com>

This adds a tests which exercise the detection of the stgit format.
There is a current know breakage in that the code that deals with stgit
in split_patches can't handle reading from stdin.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
---
 t/t4150-am.sh | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index 5edb79a..dbe3475 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -103,6 +103,15 @@ test_expect_success setup '
 		echo "X-Fake-Field: Line Three" &&
 		git format-patch --stdout first | sed -e "1d"
 	} > patch1-ws.eml &&
+	{
+		echo "From: $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>" &&
+		echo &&
+		cat msg &&
+		echo &&
+		echo "Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>" &&
+		echo "---" &&
+		git diff-tree --stat -p second | sed -e "1d"
+	} > patch1-stgit.eml &&
 
 	sed -n -e "3,\$p" msg >file &&
 	git add file &&
@@ -186,6 +195,24 @@ test_expect_success 'am applies patch e-mail with preceding whitespace' '
 	test "$(git rev-parse second^)" = "$(git rev-parse HEAD^)"
 '
 
+test_expect_success 'am applies patch generated by stgit' '
+	rm -fr .git/rebase-apply &&
+	git reset --hard &&
+	git checkout first &&
+	git am patch1-stgit.eml &&
+	test_path_is_missing .git/rebase-apply &&
+	git diff --exit-code second
+'
+
+test_expect_failure 'am applies patch using --patch-format=stgit' '
+	rm -fr .git/rebase-apply &&
+	git reset --hard &&
+	git checkout first &&
+	git am --patch-format=stgit <patch1-stgit.eml &&
+	test_path_is_missing .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" &&
-- 
2.1.0.64.gc343089

  parent reply	other threads:[~2014-09-05 10:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-05 10:06 [RFC PATCHv3 0/4] am: patch-format Chris Packham
2014-09-05 10:06 ` [RFC PATCHv3 1/4] am: avoid re-directing stdin twice Chris Packham
2014-09-05 20:26   ` Johannes Sixt
2014-09-05 21:31     ` Chris Packham
2014-09-05 22:00       ` Junio C Hamano
2014-09-05 22:16         ` Junio C Hamano
2014-09-05 22:25           ` Junio C Hamano
2014-09-05 23:18             ` Stephen Boyd
2014-09-06  7:34               ` Junio C Hamano
2014-09-06 12:46                 ` Torsten Bögershausen
2014-09-05 10:06 ` Chris Packham [this message]
2014-09-05 10:06 ` [RFC PATCHv3 3/4] t/am: add tests for hg patch format Chris Packham
2014-09-05 10:06 ` [RFC PATCHv3 4/4] am: add gitk " Chris Packham

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=1409911611-20370-3-git-send-email-judge.packham@gmail.com \
    --to=judge.packham@gmail.com \
    --cc=git@vger.kernel.org \
    /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).