From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Packham Subject: [RFC PATCHv3 2/4] t/am: add test for stgit patch format Date: Fri, 5 Sep 2014 22:06:49 +1200 Message-ID: <1409911611-20370-3-git-send-email-judge.packham@gmail.com> References: <1409911611-20370-1-git-send-email-judge.packham@gmail.com> Cc: Chris Packham To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Fri Sep 05 12:07:47 2014 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XPqQi-0005p6-US for gcvg-git-2@plane.gmane.org; Fri, 05 Sep 2014 12:07:45 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756559AbaIEKHg (ORCPT ); Fri, 5 Sep 2014 06:07:36 -0400 Received: from mail-ie0-f175.google.com ([209.85.223.175]:55009 "EHLO mail-ie0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756543AbaIEKHf (ORCPT ); Fri, 5 Sep 2014 06:07:35 -0400 Received: by mail-ie0-f175.google.com with SMTP id y20so13760952ier.34 for ; Fri, 05 Sep 2014 03:07:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wzRegNQBfSL7FTWRHFuGu3fFztB+2EUpOxgf5sXu6j8=; b=Lkx4ehswf7icMW/ixY4BSF4DI3pr0+OMsry20GivlhqOEFOgih3Pp9Iu8meXw9pYHZ qZlPdZ2juz+mbCLCF8ZoucZMFh+HbsYI9Aa/jprqbTSgy8RXAnOVPukwf7sStUsuIcjB QKupJOGYvc/6N0iUt9Jf75YhXf7CTH1dQMOweJb2VtrcMIlNLiBkO5ITjc9b27mkW1Zj t3k9BDizGchJG0qK0IEr5obcuLLi7XuS63EXQNJs95Wb3P7LYuH7ifTy5Oo+APRvabFF EnNmbRTpUHyuUqcgyDWeBt3LQscc9RyKaQDn3rtatN5Wn9B+5NongKW2ST5tVgjeH8sc fvkQ== X-Received: by 10.66.145.167 with SMTP id sv7mr19374141pab.5.1409911652201; Fri, 05 Sep 2014 03:07:32 -0700 (PDT) Received: from chrisp3-dl.ws.atlnz.lc (2-163-36-202-static.alliedtelesis.co.nz. [202.36.163.2]) by mx.google.com with ESMTPSA id o2sm1348068pdk.87.2014.09.05.03.07.30 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 05 Sep 2014 03:07:31 -0700 (PDT) X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1409911611-20370-1-git-send-email-judge.packham@gmail.com> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: 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 --- 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