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: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 1387B1F8C6 for ; Tue, 31 Aug 2021 13:13:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234483AbhHaNOV (ORCPT ); Tue, 31 Aug 2021 09:14:21 -0400 Received: from beige.elm.relay.mailchannels.net ([23.83.212.16]:27588 "EHLO beige.elm.relay.mailchannels.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234395AbhHaNOT (ORCPT ); Tue, 31 Aug 2021 09:14:19 -0400 X-Sender-Id: dreamhost|x-authsender|novalis@novalis.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 63EF89217CE; Tue, 31 Aug 2021 13:13:22 +0000 (UTC) Received: from pdx1-sub0-mail-a55.g.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 01F819215DB; Tue, 31 Aug 2021 13:13:20 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|novalis@novalis.org Received: from pdx1-sub0-mail-a55.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.112.147.104 (trex/6.4.3); Tue, 31 Aug 2021 13:13:22 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|novalis@novalis.org X-MailChannels-Auth-Id: dreamhost X-Name-White: 72cf2034670b7681_1630415602174_1532778318 X-MC-Loop-Signature: 1630415602174:3357348228 X-MC-Ingress-Time: 1630415602174 Received: from pdx1-sub0-mail-a55.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a55.g.dreamhost.com (Postfix) with ESMTP id B2DEC870F3; Tue, 31 Aug 2021 06:13:20 -0700 (PDT) Received: from corey.lan (unknown [98.113.183.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: novalis@novalis.org) by pdx1-sub0-mail-a55.g.dreamhost.com (Postfix) with ESMTPSA id 2FE7186182; Tue, 31 Aug 2021 06:13:20 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a55 From: David Turner To: git@vger.kernel.org Cc: novalis@novalis.org, David Turner Subject: [PATCH v4 3/3] diff --submodule=diff: Don't print failure message twice Date: Tue, 31 Aug 2021 09:12:57 -0400 Message-Id: <20210831131257.1631316-3-dturner@twosigma.com> X-Mailer: git-send-email 2.11.GIT In-Reply-To: <20210831131257.1631316-1-dturner@twosigma.com> References: <20210831131257.1631316-1-dturner@twosigma.com> Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org When we fail to start a diff command inside a submodule, immediately exit the routine rather than trying to finish the command and printing a second message. Signed-off-by: David Turner --- submodule.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/submodule.c b/submodule.c index 8aeff95cfd..ab5f050f0e 100644 --- a/submodule.c +++ b/submodule.c @@ -720,8 +720,10 @@ void show_submodule_inline_diff(struct diff_options *o, const char *path, strvec_push(&cp.env_array, GIT_WORK_TREE_ENVIRONMENT "=."); } - if (start_command(&cp)) + if (start_command(&cp)) { diff_emit_submodule_error(o, "(diff failed)\n"); + goto done; + } while (strbuf_getwholeline_fd(&sb, cp.out, '\n') != EOF) diff_emit_submodule_pipethrough(o, sb.buf, sb.len); -- 2.11.GIT