From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Couder Subject: [PATCH v5 13/14] trailer: add tests for commands using env variables Date: Thu, 06 Feb 2014 21:20:02 +0100 Message-ID: <20140206202004.325.2983.chriscool@tuxfamily.org> References: <20140206194123.325.99451.chriscool@tuxfamily.org> Cc: git@vger.kernel.org, Johan Herland , Josh Triplett , Thomas Rast , Michael Haggerty , Eric Sunshine , Dan Carpenter , Greg Kroah-Hartman , Jeff King To: Junio C Hamano X-From: git-owner@vger.kernel.org Thu Feb 06 21:21:43 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 1WBVSA-0003tK-Ko for gcvg-git-2@plane.gmane.org; Thu, 06 Feb 2014 21:21:43 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756034AbaBFUVj (ORCPT ); Thu, 6 Feb 2014 15:21:39 -0500 Received: from mail-2y.bbox.fr ([194.158.98.15]:43415 "EHLO mail-2y.bbox.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755537AbaBFUV1 (ORCPT ); Thu, 6 Feb 2014 15:21:27 -0500 Received: from [127.0.1.1] (cha92-h01-128-78-31-246.dsl.sta.abo.bbox.fr [128.78.31.246]) by mail-2y.bbox.fr (Postfix) with ESMTP id 4B2D14F; Thu, 6 Feb 2014 21:21:26 +0100 (CET) X-git-sha1: c1628e64419f77a9468880d66b8f6e3afb51caf1 X-Mailer: git-mail-commits v0.5.2 In-Reply-To: <20140206194123.325.99451.chriscool@tuxfamily.org> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Signed-off-by: Christian Couder --- t/t7513-interpret-trailers.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/t/t7513-interpret-trailers.sh b/t/t7513-interpret-trailers.sh index 2d50b7a..00894a8 100755 --- a/t/t7513-interpret-trailers.sh +++ b/t/t7513-interpret-trailers.sh @@ -223,6 +223,26 @@ test_expect_success 'with simple command' ' test_cmp expected actual ' +test_expect_success 'with command using commiter information' ' + git config trailer.sign.ifExist "addIfDifferent" && + git config trailer.sign.command "echo \"\$GIT_COMMITTER_NAME <\$GIT_COMMITTER_EMAIL>\"" && + cat complex_message_body >expected && + printf "Fixes: \nAcked-by= \nReviewed-by: \nSigned-off-by: \nSigned-off-by: C O Mitter \n" >>expected && + git interpret-trailers "review:" "fix=22" < complex_message >actual && + test_cmp expected actual +' + +test_expect_success 'with command using author information' ' + git config trailer.sign.key "Signed-off-by: " && + git config trailer.sign.where "after" && + git config trailer.sign.ifExist "addIfDifferentNeighbor" && + git config trailer.sign.command "echo \"\$GIT_AUTHOR_NAME <\$GIT_AUTHOR_EMAIL>\"" && + cat complex_message_body >expected && + printf "Fixes: \nAcked-by= \nReviewed-by: \nSigned-off-by: \nSigned-off-by: A U Thor \n" >>expected && + git interpret-trailers "review:" "fix=22" < complex_message >actual && + test_cmp expected actual +' + test_expect_success 'setup a commit' ' echo "Content of the first commit." > a.txt && git add a.txt && -- 1.8.5.2.206.g98f5689.dirty