This commit is contained in:
Tim Thacker 2025-01-01 14:23:24 +00:00 committed by GitHub
commit 68bc6921d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -55,6 +55,7 @@ import type {
StorageConfig,
TreeItem,
} from './types';
import { getGitEnvironmentVariables } from './auth';
export { setNoVerify } from './config';
export { setPrivateKey } from './private-key';
@ -353,6 +354,13 @@ export async function cloneSubmodules(
return;
}
submodulesInitizialized = true;
const gitSubmoduleAuthEnvironmentVariables = getGitEnvironmentVariables();
const gitEnv = {
// pass all existing env variables
...process.env,
// add all known git variables
...gitSubmoduleAuthEnvironmentVariables,
};
await syncGit();
const submodules = await getSubmodules();
for (const submodule of submodules) {
@ -366,7 +374,7 @@ export async function cloneSubmodules(
try {
logger.debug(`Cloning git submodule at ${submodule}`);
await gitRetry(() =>
git.submoduleUpdate(['--init', '--recursive', submodule]),
git.env(gitEnv).submoduleUpdate(['--init', '--recursive', submodule]),
);
} catch (err) {
logger.warn(