From patchwork Sun Mar 17 10:15:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 10856265 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 38D6215AC for ; Sun, 17 Mar 2019 10:16:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20F0E29736 for ; Sun, 17 Mar 2019 10:16:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12E6829741; Sun, 17 Mar 2019 10:16:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFD6A29736 for ; Sun, 17 Mar 2019 10:16:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727044AbfCQKQD (ORCPT ); Sun, 17 Mar 2019 06:16:03 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:35422 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725903AbfCQKQD (ORCPT ); Sun, 17 Mar 2019 06:16:03 -0400 Received: by mail-pf1-f195.google.com with SMTP id j5so9304424pfa.2 for ; Sun, 17 Mar 2019 03:16:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=JEUcjZWzAIG9eXYnfQ0anKegnuSK2H+kNBChGsHs26g=; b=bgXs/JCP/xAXxmgyvlQZAo96JrZNP0aSRz/ky7Ta1SQYz1Kyf2SA7Qq8ryWgSPgns1 S3AnZErJ+oqNVlC/yqV+Yg3d9V+4TOuOAeimgfuPx22w52Mh26/1Cp7Sq2gWZJHsMcLB gQPh/VsyyUMCfjX6cTrUzinTCF6MR21Mi0XeTIbN2lW9M9JCe95aFwib02yAgbqETDJE +Ruz1xbgM0aW44MkGHXa6joPRzHkZCJgytesEEkhsM0ChRIpC9chZ0iUIeceOmbfNMK4 aKOh6ioIU2rLbLDs+6tylV5tMLpsLBGRWlu5AFx9pyjILBTYPIWms36MfmI+K161LGEl f9YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=JEUcjZWzAIG9eXYnfQ0anKegnuSK2H+kNBChGsHs26g=; b=iHsHzxVzwHoBSNRlrwmFkYygO55yFrid68+NoDX7VD8x0p/p9IwT3pzNmP6wV4kGa3 Cf5QDs4pJq59HoSBPqp2ki6imNYVWPJVjuPpqoAxpGb8tEhPM/DULxBLKygJoRP9uwPZ KUDE1iFPS5trzjnad0VO2dyUlFy/U83FjN44ZS4RZ6oNEutXZHYpj8FFX/o6CJqWuDkC KSv0HyIICanOUBJRF66JJJxoGn0Su6sPKLMODZv9+FDTGrx2Hy4yOd3kxtYEC2G39BAb /cjT8yN3TirLbNHuwVyOyb+OzSsB8kiwsz3HVGe8aNTsuXbSOxrKSzCPsP2w9wiI00Vo oYSQ== X-Gm-Message-State: APjAAAXucTwdHlyKDRnmWqDkh0aWAur9eqtPMj6aPJ3nnIbf08eoKpmN sPpqikpwshIcoIZOmfCwsoXw54Im X-Google-Smtp-Source: APXvYqxdBu+OWiHZVl5rr0u/I/FB9ufor8AkRFqnely5eosy7xVKSvMtUTc+p33IuHJyrJy3mreRHQ== X-Received: by 2002:a17:902:ab95:: with SMTP id f21mr14212135plr.188.1552817761803; Sun, 17 Mar 2019 03:16:01 -0700 (PDT) Received: from archbookpro.localdomain (c-73-222-73-77.hsd1.ca.comcast.net. [73.222.73.77]) by smtp.gmail.com with ESMTPSA id f65sm11882167pff.21.2019.03.17.03.16.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 17 Mar 2019 03:16:01 -0700 (PDT) Date: Sun, 17 Mar 2019 03:15:59 -0700 From: Denton Liu To: Git Mailing List Cc: Denton Liu , Eric Sunshine , Junio C Hamano , Phillip Wood , Ramsay Jones , SZEDER =?iso-8859-1?q?G=E1bor?= Subject: [PATCH v8 03/11] t7604: refactor out Git commands upstream of pipe Message-ID: <9db7453b4e2b7221a039aa18509589e5c4f662b3.1552817044.git.liu.denton@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Before, we had some Git commands which were upstream of the pipe. This meant that if it produced an error, it would've gone unnoticed. Refactor to place Git commands on their own. Helped-by: Eric Sunshine Signed-off-by: Denton Liu --- t/t7604-merge-custom-message.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/t/t7604-merge-custom-message.sh b/t/t7604-merge-custom-message.sh index 89619cf446..b045fdb413 100755 --- a/t/t7604-merge-custom-message.sh +++ b/t/t7604-merge-custom-message.sh @@ -36,14 +36,18 @@ test_expect_success 'setup' ' test_expect_success 'merge c2 with a custom message' ' git reset --hard c1 && git merge -m "$(cat exp.subject)" c2 && - git cat-file commit HEAD | sed -e "1,/^$/d" >actual && + git cat-file commit HEAD >actual && + sed -e "1,/^$/d" tmp && + mv tmp actual && test_cmp exp.subject actual ' test_expect_success 'merge --log appends to custom message' ' git reset --hard c1 && git merge --log -m "$(cat exp.subject)" c2 && - git cat-file commit HEAD | sed -e "1,/^$/d" >actual && + git cat-file commit HEAD >actual && + sed -e "1,/^$/d" tmp && + mv tmp actual && test_cmp exp.log actual '