From patchwork Tue Nov 3 14:23:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kaestle X-Patchwork-Id: 11877757 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 324B6C388F7 for ; Tue, 3 Nov 2020 14:24:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CF4AF22280 for ; Tue, 3 Nov 2020 14:24:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nokia.onmicrosoft.com header.i=@nokia.onmicrosoft.com header.b="JV/6+5GE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729562AbgKCOYL (ORCPT ); Tue, 3 Nov 2020 09:24:11 -0500 Received: from mail-eopbgr00109.outbound.protection.outlook.com ([40.107.0.109]:35173 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729585AbgKCOXr (ORCPT ); Tue, 3 Nov 2020 09:23:47 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=joLMa08m8P0edL8X0yi0/aNvTnKop6gpJ1gvr/AM7CcVH3w7EbbTA/kat6KpJ/2xGZKNQI1jpw/nfOkmManWIX/cj3fTM27PtRI5F4fWd6P8slXJuWtxbb+W41U9b8NjcprdJERZhmACv4iDJPf9sznlcTlCtR4BqU1WhVQsGNxl/iHhhwJiWiMtBWxB4OPdqZFc6U67iomD4i33UdET6pGwCLeU6K/XgvXCt4dmgQvKGuIplNjkHoZIONERIG7vCMmuUgCKHUzNo6GX4GRh4yhPz0KSsZuYPlsuSIkFgecQfA9hFACSDVGhes9Pm2Ajv9EDTboGAlFLDvL06OEV3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YuHOuAU9rIic9L7tfZiRJpgSbiVRXpIRWxFidY0iao0=; b=POrnBqf1EJY3V3pLaifBBwqtclYh2RMDL0i1I6G+JobgDZ7piKyQV6IuB1z1uOtt4yxsJQjPOzBhf9ZtEqGAH4esqvEutQ9l2TBs2dk/hL1uvFVBMj8J4RO/gTXrLfr6e6LsIFlxH8FFGdKVwIjfK0QlUeOgUQJVMvdOptWHfT+qTFUa8j0jY5NsJXt9+f40NvyGR50zi4NB2eZjKe5KJeBsumo3aWEKMq0UxM8cIHO20wo1cS2zzpf89f1K/yP+H4eucks5cPNeIWhKW7lVSEQ6YM90Z1E/RsoWuEh67fOBcsdJC79RKXDP/D3C8b9Z3slB4X1TM7dgCNSl+Y8sfA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 131.228.6.101) smtp.rcpttodomain=google.com smtp.mailfrom=nokia.com; dmarc=fail (p=none sp=none pct=100) action=none header.from=nokia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YuHOuAU9rIic9L7tfZiRJpgSbiVRXpIRWxFidY0iao0=; b=JV/6+5GEeWutMKqEUaIIkmggDJTKrGmU/rrIEmQvUslMBnVqMrWP/PPpV9+wpTy7luy1k3FClvRXqbl4PMzfGu/erJyQP8biTph1txbgREqsxiCS5Ugj+7nSIZaOL8LbM8tmZu9Vqg4Fn8Zmy8vyuVFYSAlNfAvnrFBCFs7KFyQ= Received: from MR2P264CA0127.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:30::19) by DB7PR07MB6025.eurprd07.prod.outlook.com (2603:10a6:10:85::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3541.10; Tue, 3 Nov 2020 14:23:41 +0000 Received: from VE1EUR03FT046.eop-EUR03.prod.protection.outlook.com (2603:10a6:500:30:cafe::90) by MR2P264CA0127.outlook.office365.com (2603:10a6:500:30::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Tue, 3 Nov 2020 14:23:41 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 131.228.6.101) smtp.mailfrom=nokia.com; google.com; dkim=none (message not signed) header.d=none;google.com; dmarc=fail action=none header.from=nokia.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning nokia.com discourages use of 131.228.6.101 as permitted sender) Received: from fr712usmtp1.zeu.alcatel-lucent.com (131.228.6.101) by VE1EUR03FT046.mail.protection.outlook.com (10.152.19.226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3520.15 via Frontend Transport; Tue, 3 Nov 2020 14:23:40 +0000 Received: from ulegcpbofur.emea.nsn-net.net (ulegcpbofur.emea.nsn-net.net [10.151.74.147]) by fr712usmtp1.zeu.alcatel-lucent.com (GMO) with ESMTP id 0A3ENbo7005363; Tue, 3 Nov 2020 14:23:37 GMT From: Peter Kaestle To: Junio C Hamano , git@vger.kernel.org, Stefan Beller Cc: peter.kaestle@nokia.com Subject: [REGRESSION FIX 1/2] submodules: test for fetch of non-init subsub-repo Date: Tue, 3 Nov 2020 15:23:18 +0100 Message-Id: <1604413399-63090-2-git-send-email-peter.kaestle@nokia.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1604413399-63090-1-git-send-email-peter.kaestle@nokia.com> References: <1604413399-63090-1-git-send-email-peter.kaestle@nokia.com> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 037a6252-417f-4ae6-69a8-08d880041010 X-MS-TrafficTypeDiagnostic: DB7PR07MB6025: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1775; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vmp0vsc5/QSlNXhgcfZz+Lh0Aa/BQ/MATPUjTeR6UbBuplm9bsPZZ4sZy+1hzQQYnKrAlOY/2WG86QS7Di0jVz4PGD8owF8DrULiI/Q6P+7ea3wXfnJ1WPJ7ZDrPWKeF/blyBW8OTARrkdMMu1bY9KR8zKKyyqj1F4hEleOk6slItrtK9tdzBONPzk+k1ywyorh2W6g5xHDbUPi8UulrIMPrsXfNrq/ih6KCD726vA0eLaxGXgFIO37WWofr4fgXTPHK4mFngzFFUguKPlzxoLelbGPFjGZGnx8tY+sVyIuUE3LhuXjxI0k5uS0u6ET4goNRDnU1HD5QnDjP5pAe/rvuCJTSAw8RhHKBdQwMF9JefIWjWvoOGJzu2wjdsmTFn3YBUvK2Q1Ok0mxc3AE6Qg== X-Forefront-Antispam-Report: CIP:131.228.6.101;CTRY:FI;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:fr712usmtp1.zeu.alcatel-lucent.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(39860400002)(136003)(346002)(376002)(396003)(46966005)(36756003)(44832011)(5660300002)(336012)(6666004)(82310400003)(26005)(2616005)(110136005)(186003)(86362001)(4326008)(107886003)(356005)(81166007)(70586007)(82740400003)(70206006)(36906005)(8676002)(2906002)(478600001)(47076004)(8936002)(316002)(83380400001);DIR:OUT;SFP:1102; X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2020 14:23:40.9741 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 037a6252-417f-4ae6-69a8-08d880041010 X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0;Ip=[131.228.6.101];Helo=[fr712usmtp1.zeu.alcatel-lucent.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT046.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR07MB6025 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This test case triggers a regression, which was introduced by a62387b3fc9f5aeeb04a2db278121d33a9caafa7 in following setup: outer_repo/middle_repo/inner_repo and a change in the remote of inner_repo happens. Then it's being fetched by a second clone of the outer repo, in which the middle is initialized, but the inner is not. This causes is_empty_dir() in submodule.c:get_next_submodule() to check for a directory only existing in the actual worktree, while the is_empty_dir() being called from .git/modules. Signed-off-by: Peter Kaestle --- t/t5526-fetch-submodules.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh index dd8e423..9fbd481 100755 --- a/t/t5526-fetch-submodules.sh +++ b/t/t5526-fetch-submodules.sh @@ -719,4 +719,42 @@ test_expect_success 'fetch new submodule commit intermittently referenced by sup ) ' +add_commit_push() +{ + dir="$1" + msg="$2" + shift 2 + git -C "$dir" add "$@" && + git -C "$dir" commit -a -m "$msg" && + git -C "$dir" push +} + +test_expect_failure 'fetching a superproject containing an uninitialized sub/sub project' ' + # does not depend on any previous test setups + + for repo in outer middle inner + do + git init --bare $repo && + git clone $repo ${repo}_content && + echo $repo > ${repo}_content/file && + add_commit_push ${repo}_content "initial" file + done && + + git clone outer A && + git -C A submodule add "$pwd/middle" && + git -C A/middle/ submodule add "$pwd/inner" && + add_commit_push A/middle/ "adding inner sub" .gitmodules inner && + add_commit_push A/ "adding middle sub" .gitmodules middle && + + git clone outer B && + git -C B/ submodule update --init middle && + + echo "change on inner repo of A" > A/middle/inner/file && + add_commit_push A/middle/inner "change on inner" file && + add_commit_push A/middle "change on inner" inner && + add_commit_push A "change on inner" middle && + + git -C B/ fetch +' + test_done From patchwork Tue Nov 3 14:23:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Kaestle X-Patchwork-Id: 11877759 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08764C2D0A3 for ; Tue, 3 Nov 2020 14:24:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A6F8422280 for ; Tue, 3 Nov 2020 14:24:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nokia.onmicrosoft.com header.i=@nokia.onmicrosoft.com header.b="FXDV0cNJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729599AbgKCOYN (ORCPT ); Tue, 3 Nov 2020 09:24:13 -0500 Received: from mail-eopbgr60105.outbound.protection.outlook.com ([40.107.6.105]:29101 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729539AbgKCOXo (ORCPT ); Tue, 3 Nov 2020 09:23:44 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ds8SW/fxEjjA8WI1sOczax9oGv9pyWEhH+zwoHyehXyLQNq/J3melCRhgHj5ZRiDVV9eDl8p6g6ahVEfhT8zBOTG97HZkfYk2H90EAh3kfelJZTz8Sl2eM802LiN4hO9zqMYAlPe2g926EMBO7IttT4EVtsevHdjg8f7YsSxd9ICe/oRTYyUYV17/CjR3HtShN5YrpNQMnC+9Dn8awE1fvk03HS8kpKCsT9OUdkS8/CIT0SC6VwoEvSlbzIRNkHj0RxN6jLNMsPD8JcdPkHFmgXshbE5jqftQjy271w9xpEPnRgF8meLcyq8gzMdTDTsprPh5tRQyKdcI+/JOQYNMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=l2PNQMWoGDCdC8a4IVFsznFXLFlFHgGAN3t8JLnPn4A=; b=InMcw8mmnSsrA0DRD3vS8wmVzMTSKaUvINN1E9A5eqCPxrAXxCuBH6pAUV4vNTC5swGRTC1F/SR2xG4UTHBd6MvvcIt9ySFtnCIyL3WrTOupmlXfuKzaajZ2wRnrfa77RaHy3V0AoZm5d8qH8SeIFDJe1Dq2vuNEzqjrJO2u+lx95gZtOtcZNpUezaGzMUxpnFPKVeObUfZlAkVLzWBpWdQaZTNK+FFYp/FmlddBF8zyREw4RGDmXDo5ZVtmiT9dafIcyOugD3RpBxaJOSqwMLWwY+jAGrMcOKp7hHdbjHS6mInl3u3x1f+0eJYrIgQo4gUcZUc2WuJOCj9fO1I3KA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 131.228.6.101) smtp.rcpttodomain=google.com smtp.mailfrom=nokia.com; dmarc=fail (p=none sp=none pct=100) action=none header.from=nokia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=l2PNQMWoGDCdC8a4IVFsznFXLFlFHgGAN3t8JLnPn4A=; b=FXDV0cNJSk6HnJzMs1UlU9Jj32Pnmx9T6+xMx23KxTKD9KR/IBC9yl/a9fgreocJtpIxuRIyrXp3RDQN81EUTX94WttY4PMNBMy41cMf2MAM97HfRrwLk+mm0KR57nQQfMD9k55JfL4i5gAMZfLcoD/7ZEEZROD+v4caq6EFy4o= Received: from MR2P264CA0039.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500::27) by AM8PR07MB7634.eurprd07.prod.outlook.com (2603:10a6:20b:24d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3541.10; Tue, 3 Nov 2020 14:23:42 +0000 Received: from VE1EUR03FT011.eop-EUR03.prod.protection.outlook.com (2603:10a6:500:0:cafe::ae) by MR2P264CA0039.outlook.office365.com (2603:10a6:500::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Tue, 3 Nov 2020 14:23:42 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 131.228.6.101) smtp.mailfrom=nokia.com; google.com; dkim=none (message not signed) header.d=none;google.com; dmarc=fail action=none header.from=nokia.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning nokia.com discourages use of 131.228.6.101 as permitted sender) Received: from fr712usmtp1.zeu.alcatel-lucent.com (131.228.6.101) by VE1EUR03FT011.mail.protection.outlook.com (10.152.18.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3520.15 via Frontend Transport; Tue, 3 Nov 2020 14:23:41 +0000 Received: from ulegcpbofur.emea.nsn-net.net (ulegcpbofur.emea.nsn-net.net [10.151.74.147]) by fr712usmtp1.zeu.alcatel-lucent.com (GMO) with ESMTP id 0A3ENbo8005363; Tue, 3 Nov 2020 14:23:38 GMT From: Peter Kaestle To: Junio C Hamano , git@vger.kernel.org, Stefan Beller Cc: peter.kaestle@nokia.com Subject: [REGRESSION FIX 2/2] Revert "submodule.c: fetch in submodules git directory instead of in worktree" Date: Tue, 3 Nov 2020 15:23:19 +0100 Message-Id: <1604413399-63090-3-git-send-email-peter.kaestle@nokia.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1604413399-63090-1-git-send-email-peter.kaestle@nokia.com> References: <1604413399-63090-1-git-send-email-peter.kaestle@nokia.com> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 382141dc-428c-4ce5-47e7-08d880041098 X-MS-TrafficTypeDiagnostic: AM8PR07MB7634: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:127; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TcZOktR1esJTMHzPk76iolwWfoNR0mkheNz1SKUnNNIxcYRMyEyl+AAXwyBTtBGTgE87mnNCfNp7XGff6HovYgut85zZMkpY6ywggk80N01LXHO8BcwZ6LknMHHWtPyeXIVdav0t76tLMCLPwtj4qRa1v6OZOmg1h5ZjH7Ab34uNtPySxjfw6d/OgJBSmnuEmEBE0JWr7G3BvxJZZVuZvZToQcq2Wbxs1lno0jK86w4sl7rk/CSbiTRilp3v/bLYVogI5q6vSk4ZWzSigZJww21F95TPeidx+ehuzveapjn5IgTdZ3n8VCLmlNWcS5Q6zlhX5wLXZIdtSPmF52XNXV64BwTnpBx2+pXTJkgQRRoiSxwagVgZylIv/Ed/cALXy5+1sF6ULUg6tjAghx1nqg== X-Forefront-Antispam-Report: CIP:131.228.6.101;CTRY:FI;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:fr712usmtp1.zeu.alcatel-lucent.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(376002)(346002)(136003)(396003)(39860400002)(46966005)(478600001)(44832011)(110136005)(82310400003)(2906002)(36906005)(83380400001)(316002)(2616005)(6666004)(336012)(82740400003)(81166007)(26005)(4326008)(107886003)(47076004)(36756003)(70206006)(186003)(356005)(8936002)(8676002)(86362001)(70586007)(5660300002);DIR:OUT;SFP:1102; X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2020 14:23:41.8635 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 382141dc-428c-4ce5-47e7-08d880041098 X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0;Ip=[131.228.6.101];Helo=[fr712usmtp1.zeu.alcatel-lucent.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT011.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR07MB7634 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This reverts commit a62387b3fc9f5aeeb04a2db278121d33a9caafa7 and sets the "fetching a superproject containing an uninitialized sub/sub project" testcase to expect success. Signed-off-by: Peter Kaestle --- submodule.c | 14 ++++---------- t/t5526-fetch-submodules.sh | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/submodule.c b/submodule.c index b3bb59f..eef5204e 100644 --- a/submodule.c +++ b/submodule.c @@ -499,12 +499,6 @@ void prepare_submodule_repo_env(struct strvec *out) DEFAULT_GIT_DIR_ENVIRONMENT); } -static void prepare_submodule_repo_env_in_gitdir(struct strvec *out) -{ - prepare_submodule_repo_env_no_git_dir(out); - strvec_pushf(out, "%s=.", GIT_DIR_ENVIRONMENT); -} - /* * Initialize a repository struct for a submodule based on the provided 'path'. * @@ -1455,8 +1449,8 @@ static int get_next_submodule(struct child_process *cp, if (task->repo) { struct strbuf submodule_prefix = STRBUF_INIT; child_process_init(cp); - cp->dir = task->repo->gitdir; - prepare_submodule_repo_env_in_gitdir(&cp->env_array); + cp->dir = task->repo->worktree; + prepare_submodule_repo_env(&cp->env_array); cp->git_cmd = 1; if (!spf->quiet) strbuf_addf(err, _("Fetching submodule %s%s\n"), @@ -1505,9 +1499,9 @@ static int get_next_submodule(struct child_process *cp, spf->prefix, task->sub->path); child_process_init(cp); - prepare_submodule_repo_env_in_gitdir(&cp->env_array); + prepare_submodule_repo_env(&cp->env_array); cp->git_cmd = 1; - cp->dir = task->repo->gitdir; + cp->dir = task->repo->worktree; strvec_init(&cp->args); strvec_pushv(&cp->args, spf->args.v); diff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh index 9fbd481..236e26a 100755 --- a/t/t5526-fetch-submodules.sh +++ b/t/t5526-fetch-submodules.sh @@ -729,7 +729,7 @@ add_commit_push() git -C "$dir" push } -test_expect_failure 'fetching a superproject containing an uninitialized sub/sub project' ' +test_expect_success 'fetching a superproject containing an uninitialized sub/sub project' ' # does not depend on any previous test setups for repo in outer middle inner