Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reset and clean for submodules #628

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move reset and clean before update
  • Loading branch information
AceCoderLaura committed Feb 24, 2022
commit 30cd0465ca954484b26b37e13ce00af381bfa678
6 changes: 4 additions & 2 deletions src/git-source-provider.ts
Original file line number Diff line number Diff line change
@@ -176,15 +176,17 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
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)
await git.submoduleUpdate(
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