GH#354 Disabled auth submodules config when related setting is false

This should help with https://github.com/actions/checkout/issues/354.
The problem is that I have no idea whether such auth submodules configuration
is required even when settings.submodules is false.
This commit is contained in:
Cosimo Streppone
2021-01-13 09:42:33 +01:00
parent 5a4ac9002d
commit 66145e68c7
2 changed files with 11 additions and 5 deletions

View File

@@ -341,10 +341,12 @@ class GitAuthHelper {
}
}
const pattern = regexpHelper.escape(configKey)
await this.git.submoduleForeach(
`git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :`,
true
)
if (this.settings.submodules) {
const pattern = regexpHelper.escape(configKey)
await this.git.submoduleForeach(
`git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :`,
true
)
}
}
}