From 38cc68387c3b860d300c418c96d22b847a064a94 Mon Sep 17 00:00:00 2001 From: Samuel Lijin Date: Tue, 27 Jun 2023 16:36:44 -0700 Subject: [PATCH 1/3] fix(lfs): ensure that LFS objects are checked out --- src/git-command-manager.ts | 5 +++++ src/git-source-provider.ts | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index e684dba..cf6549e 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -39,6 +39,7 @@ export interface IGitCommandManager { getWorkingDirectory(): string init(): Promise isDetached(): Promise + lfsCheckout(): Promise lfsFetch(ref: string): Promise lfsInstall(): Promise log1(format?: string): Promise @@ -319,6 +320,10 @@ class GitCommandManager { return !output.stdout.trim().startsWith('refs/heads/') } + async lfsCheckout(): Promise { + await this.execGit(['lfs', 'checkout']) + } + async lfsFetch(ref: string): Promise { const args = ['lfs', 'fetch', 'origin', ref] diff --git a/src/git-source-provider.ts b/src/git-source-provider.ts index 8f9d63f..5086fd4 100644 --- a/src/git-source-provider.ts +++ b/src/git-source-provider.ts @@ -211,6 +211,11 @@ export async function getSource(settings: IGitSourceSettings): Promise { await git.checkout(checkoutInfo.ref, checkoutInfo.startPoint) core.endGroup() + // LFS checkout + core.startGroup('Checking out LFS objects') + await git.lfsCheckout() + core.endGroup() + // Submodules if (settings.submodules) { // Temporarily override global config From 6a27b96959766188687a37718c95ffb1b02654c7 Mon Sep 17 00:00:00 2001 From: Sam Lijin Date: Fri, 24 Jul 2026 15:35:44 -0700 Subject: [PATCH 2/3] Apply suggestion from @bdeeming Co-authored-by: BD --- src/git-source-provider.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/git-source-provider.ts b/src/git-source-provider.ts index 5086fd4..197a64d 100644 --- a/src/git-source-provider.ts +++ b/src/git-source-provider.ts @@ -212,9 +212,11 @@ export async function getSource(settings: IGitSourceSettings): Promise { core.endGroup() // LFS checkout - core.startGroup('Checking out LFS objects') - await git.lfsCheckout() - core.endGroup() + if (settings.lfs && !settings.sparseCheckout) { + core.startGroup('Checking out LFS objects') + await git.lfsCheckout() + core.endGroup() + } // Submodules if (settings.submodules) { From 4e91896422bba863fdb3b90ebf126bd835541f6b Mon Sep 17 00:00:00 2001 From: Sam Lijin Date: Fri, 24 Jul 2026 17:42:15 -0700 Subject: [PATCH 3/3] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/git-source-provider.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/git-source-provider.ts b/src/git-source-provider.ts index 197a64d..9a8340e 100644 --- a/src/git-source-provider.ts +++ b/src/git-source-provider.ts @@ -213,9 +213,9 @@ export async function getSource(settings: IGitSourceSettings): Promise { // LFS checkout if (settings.lfs && !settings.sparseCheckout) { - core.startGroup('Checking out LFS objects') - await git.lfsCheckout() - core.endGroup() + core.startGroup('Checking out LFS objects') + await git.lfsCheckout() + core.endGroup() } // Submodules