mirror of
https://github.com/actions/checkout.git
synced 2026-07-30 10:29:08 +00:00
Merge 8471d8a73a into f548e57e54
This commit is contained in:
commit
48c48811c5
9
dist/index.js
vendored
9
dist/index.js
vendored
|
|
@ -35816,6 +35816,9 @@ class GitCommandManager {
|
||||||
const output = await this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
|
const output = await this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
|
||||||
return !output.stdout.trim().startsWith('refs/heads/');
|
return !output.stdout.trim().startsWith('refs/heads/');
|
||||||
}
|
}
|
||||||
|
async lfsCheckout() {
|
||||||
|
await this.execGit(['lfs', 'checkout']);
|
||||||
|
}
|
||||||
async lfsFetch(ref) {
|
async lfsFetch(ref) {
|
||||||
const args = ['lfs', 'fetch', 'origin', ref];
|
const args = ['lfs', 'fetch', 'origin', ref];
|
||||||
const that = this;
|
const that = this;
|
||||||
|
|
@ -41879,6 +41882,12 @@ async function getSource(settings) {
|
||||||
startGroup('Checking out the ref');
|
startGroup('Checking out the ref');
|
||||||
await git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
|
await git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
|
||||||
endGroup();
|
endGroup();
|
||||||
|
// LFS checkout
|
||||||
|
if (settings.lfs && !settings.sparseCheckout) {
|
||||||
|
startGroup('Checking out LFS objects');
|
||||||
|
await git.lfsCheckout();
|
||||||
|
endGroup();
|
||||||
|
}
|
||||||
// Submodules
|
// Submodules
|
||||||
if (settings.submodules) {
|
if (settings.submodules) {
|
||||||
// Temporarily override global config
|
// Temporarily override global config
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ export interface IGitCommandManager {
|
||||||
getWorkingDirectory(): string
|
getWorkingDirectory(): string
|
||||||
init(objectFormat?: string): Promise<void>
|
init(objectFormat?: string): Promise<void>
|
||||||
isDetached(): Promise<boolean>
|
isDetached(): Promise<boolean>
|
||||||
|
lfsCheckout(): Promise<void>
|
||||||
lfsFetch(ref: string): Promise<void>
|
lfsFetch(ref: string): Promise<void>
|
||||||
lfsInstall(): Promise<void>
|
lfsInstall(): Promise<void>
|
||||||
log1(format?: string): Promise<string>
|
log1(format?: string): Promise<string>
|
||||||
|
|
@ -383,6 +384,10 @@ class GitCommandManager {
|
||||||
return !output.stdout.trim().startsWith('refs/heads/')
|
return !output.stdout.trim().startsWith('refs/heads/')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async lfsCheckout(): Promise<void> {
|
||||||
|
await this.execGit(['lfs', 'checkout'])
|
||||||
|
}
|
||||||
|
|
||||||
async lfsFetch(ref: string): Promise<void> {
|
async lfsFetch(ref: string): Promise<void> {
|
||||||
const args = ['lfs', 'fetch', 'origin', ref]
|
const args = ['lfs', 'fetch', 'origin', ref]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -271,6 +271,13 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
|
||||||
await git.checkout(checkoutInfo.ref, checkoutInfo.startPoint)
|
await git.checkout(checkoutInfo.ref, checkoutInfo.startPoint)
|
||||||
core.endGroup()
|
core.endGroup()
|
||||||
|
|
||||||
|
// LFS checkout
|
||||||
|
if (settings.lfs && !settings.sparseCheckout) {
|
||||||
|
core.startGroup('Checking out LFS objects')
|
||||||
|
await git.lfsCheckout()
|
||||||
|
core.endGroup()
|
||||||
|
}
|
||||||
|
|
||||||
// Submodules
|
// Submodules
|
||||||
if (settings.submodules) {
|
if (settings.submodules) {
|
||||||
// Temporarily override global config
|
// Temporarily override global config
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue