mirror of
https://code.forgejo.org/actions/checkout.git
synced 2024-11-05 02:02:51 +01:00
fix(lfs): ensure that LFS objects are checked out
This commit is contained in:
parent
96f53100ba
commit
38cc68387c
2 changed files with 10 additions and 0 deletions
|
@ -39,6 +39,7 @@ export interface IGitCommandManager {
|
||||||
getWorkingDirectory(): string
|
getWorkingDirectory(): string
|
||||||
init(): Promise<void>
|
init(): 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>
|
||||||
|
@ -319,6 +320,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]
|
||||||
|
|
||||||
|
|
|
@ -211,6 +211,11 @@ 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
|
||||||
|
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