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