mirror of
https://github.com/actions/checkout.git
synced 2025-06-23 15:46:10 +02:00
Merge 65f77605c0
into 09d2acae67
This commit is contained in:
commit
2e696d95b4
10 changed files with 71 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue