This commit is contained in:
Nacho Orlandoni 2025-06-09 16:25:07 -06:00 committed by GitHub
commit 2e696d95b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 71 additions and 1 deletions

View file

@ -113,6 +113,18 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
await git.init()
await git.remoteAdd('origin', repositoryUrl)
core.endGroup()
if (settings.reference !== undefined) {
const alternateObjects = path.join(settings.reference, '/objects')
if (fsHelper.directoryExistsSync(alternateObjects, false)) {
core.startGroup('Adding a reference repository')
await git.referenceAdd(alternateObjects)
core.endGroup()
} else {
core.warning(`Reference repository was specified, but directory ${alternateObjects} does not exists`);
}
}
}
// Disable automatic garbage collection