From 30cd0465ca954484b26b37e13ce00af381bfa678 Mon Sep 17 00:00:00 2001 From: Laura Bailey Date: Thu, 24 Feb 2022 13:41:42 +1100 Subject: [PATCH] Move reset and clean before update --- src/git-source-provider.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/git-source-provider.ts b/src/git-source-provider.ts index b95ce3a..487385c 100644 --- a/src/git-source-provider.ts +++ b/src/git-source-provider.ts @@ -176,6 +176,10 @@ export async function getSource(settings: IGitSourceSettings): Promise { await authHelper.configureGlobalAuth() core.endGroup() + // Clean existing submodules + await git.submoduleReset(settings.nestedSubmodules) + await git.submoduleClean(settings.nestedSubmodules) + // Checkout submodules core.startGroup('Fetching submodules') await git.submoduleSync(settings.nestedSubmodules) @@ -183,8 +187,6 @@ export async function getSource(settings: IGitSourceSettings): Promise { settings.fetchDepth, settings.nestedSubmodules ) - await git.submoduleReset(settings.nestedSubmodules) - await git.submoduleClean(settings.nestedSubmodules) await git.submoduleForeach( 'git config --local gc.auto 0', settings.nestedSubmodules