fix(git-submodules): sequential submodules processing (#11659) (#11661)

This commit is contained in:
Eric Citaire 2021-09-09 17:34:09 +02:00 committed by GitHub
parent 955942b563
commit f4ebbb78a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -98,9 +98,8 @@ export default async function extractPackageFile(
return null;
}
const deps = (
await Promise.all(
depNames.map(async ({ name, path }) => {
const deps = [];
for (const { name, path } of depNames) {
try {
const [currentDigest] = (await git.subModule(['status', path]))
.trim()
@ -116,22 +115,16 @@ export default async function extractPackageFile(
name,
httpSubModuleUrl
);
return {
deps.push({
depName: path,
lookupName: getHttpUrl(subModuleUrl),
currentValue,
currentDigest,
};
});
} catch (err) /* istanbul ignore next */ {
logger.warn(
{ err },
'Error mapping git submodules during extraction'
);
return null;
logger.warn({ err }, 'Error mapping git submodules during extraction');
}
}
})
)
).filter(Boolean);
return { deps, datasource: datasourceGitRefs.id };
}