From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id A07CB1F463 for ; Fri, 22 Nov 2019 19:00:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727073AbfKVTAC (ORCPT ); Fri, 22 Nov 2019 14:00:02 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:37939 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726739AbfKVTAC (ORCPT ); Fri, 22 Nov 2019 14:00:02 -0500 Received: by mail-pl1-f195.google.com with SMTP id q18so3463591pls.5 for ; Fri, 22 Nov 2019 11:00:01 -0800 (PST) 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=QZ5szS++jPGn+He2yAIgGt7U3Hfc4j5JqnCCTkat6rQ=; b=Tm8bTHuZtJUF/0DpsZvhbDnRT761q5b9dWxhfgEJ6BQKoZ3EjwCAn/BeCFU+1gcTAu QR95taIZS8oHhi7tbMaJD6e0IoxamDIWC+YAu8ax+FTBOhQvTPcLXhiIE37Qt0ylo/sE 0TuEp9UQ2srBQPnNDBgbBnG802KAwcxcy3GhnXF2yqn0gauRQ4zYpBroEWdLITLCXu4G atgDfOr3KKOEsUJP0dy/jVs436CrGYBLQgfLTH0GOICXcMNoigpjjLQnOEbcQS4uIRYc h0B5ZXknsP1bUd+bQghCqxU1IuDhxbIYz+ah9bVokNIs1zmlwi2+MvnLzLy0ENmE1EwL gefQ== 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=QZ5szS++jPGn+He2yAIgGt7U3Hfc4j5JqnCCTkat6rQ=; b=pXLWPNmNCnRQWGKzIRHv9Gtvd4xZpIAWQQcDCG4gosZogeQ/mrH56XEwv3PQY5gZ6z sM6FrJzQaAxIoa/8/V+ok5JlCoJYq+T56KTGxavqU8CS4ecCCFYknxjlilsGm1sQ91lm BcQ4qsuNWT1EWoMZTqop1IvZ+TPvti3NvwaUyDGkMqViCLd43q+WrVC9ldlUvhBrBfzq m0EPjO3oZpwmZjLq1OGL7LIOGHHiurkcDKVYfG6d3+n9f63yR91zax4ANw4v5PDtNYtD SrldDJWTN1RetPOPq3EemXFaVn+mddDSoelaWpSfnnlLOElko5kzUS/iy82RsklP6iK/ mSfw== X-Gm-Message-State: APjAAAXEXTRcTEqMsv7B8roV2j/3pdQjqSOx1VoZvgGrawkEnzqMSozI MDMAegKllNOZJWUXZLeuzoSPl9C4 X-Google-Smtp-Source: APXvYqyUZFdO1TcJSkW7fRCfXc+8M519HT9opA3Lm0BOZOHsi9KLWqy0WABs5HU141mfZOwQZcDPSA== X-Received: by 2002:a17:90a:7bcc:: with SMTP id d12mr20756602pjl.63.1574449201242; Fri, 22 Nov 2019 11:00:01 -0800 (PST) Received: from generichostname ([204.14.239.138]) by smtp.gmail.com with ESMTPSA id y4sm7977598pfn.97.2019.11.22.11.00.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Nov 2019 11:00:00 -0800 (PST) Date: Fri, 22 Nov 2019 10:59:59 -0800 From: Denton Liu To: Git Mailing List Cc: Eric Sunshine , Junio C Hamano , Jeff King Subject: [PATCH v3 07/22] t3600: stop losing return codes of git commands Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org When a command is in a non-assignment command substitution, the return code will be lost in favour of the surrounding command's. As a result, if a git command fails, we won't know about it. Rewrite instances of this so that git commands are either run in an assignment-only command substitution so that their return codes aren't lost. Signed-off-by: Denton Liu --- t/t3600-rm.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh index f6e659b7e9..0c3bf10edd 100755 --- a/t/t3600-rm.sh +++ b/t/t3600-rm.sh @@ -304,7 +304,8 @@ EOF test_expect_success 'rm removes empty submodules from work tree' ' mkdir submod && - git update-index --add --cacheinfo 160000 $(git rev-parse HEAD) submod && + hash=$(git rev-parse HEAD) && + git update-index --add --cacheinfo 160000 "$hash" submod && git config -f .gitmodules submodule.sub.url ./. && git config -f .gitmodules submodule.sub.path submod && git submodule init && @@ -623,7 +624,8 @@ test_expect_success 'setup subsubmodule' ' git submodule update && ( cd submod && - git update-index --add --cacheinfo 160000 $(git rev-parse HEAD) subsubmod && + hash=$(git rev-parse HEAD) && + git update-index --add --cacheinfo 160000 "$hash" subsubmod && git config -f .gitmodules submodule.sub.url ../. && git config -f .gitmodules submodule.sub.path subsubmod && git submodule init && -- 2.24.0.497.g17aadd8971