From 7e5ce0d382aad302db4db79dc7400957f83cd0a5 Mon Sep 17 00:00:00 2001 From: Samuel K Date: Thu, 30 Jul 2026 17:49:29 -0500 Subject: [PATCH] fix(git): also disable filter.lfs.required when git-lfs binary is missing A prior `git lfs install` on an image can leave filter.lfs.required=true in system/global git config even after the git-lfs binary is removed. With it set, disabling the smudge/clean/process filters isn't enough: git still treats the filter as required and aborts checkout with "smudge filter lfs failed" instead of falling back to the pointer stub. --- e2e/tests/up/git_lfs_test.go | 2 ++ pkg/git/lfs.go | 1 + 2 files changed, 3 insertions(+) diff --git a/e2e/tests/up/git_lfs_test.go b/e2e/tests/up/git_lfs_test.go index eabe42e18..c72dedb44 100644 --- a/e2e/tests/up/git_lfs_test.go +++ b/e2e/tests/up/git_lfs_test.go @@ -74,6 +74,7 @@ func simulateStaleGlobalLFSConfig(t *testing.T) { runGit(t, home, "config", "--global", "filter.lfs.process", "git-lfs filter-process") runGit(t, home, "config", "--global", "filter.lfs.smudge", "git-lfs smudge -- %f") runGit(t, home, "config", "--global", "filter.lfs.clean", "git-lfs clean -- %f") + runGit(t, home, "config", "--global", "filter.lfs.required", "true") } // newLFSFixtureRepo creates a repo declaring an LFS-tracked file, using local @@ -86,6 +87,7 @@ func newLFSFixtureRepo(t *testing.T) string { runGit(t, dir, "config", "filter.lfs.clean", "cat") runGit(t, dir, "config", "filter.lfs.smudge", "cat") runGit(t, dir, "config", "filter.lfs.process", "") + runGit(t, dir, "config", "filter.lfs.required", "false") writeFile( t, diff --git a/pkg/git/lfs.go b/pkg/git/lfs.go index 0904e7912..1a7034935 100644 --- a/pkg/git/lfs.go +++ b/pkg/git/lfs.go @@ -21,6 +21,7 @@ var lfsDisableFilterArgs = []string{ flagConfig, "filter.lfs.process=", flagConfig, "filter.lfs.smudge=cat", flagConfig, "filter.lfs.clean=cat", + flagConfig, "filter.lfs.required=false", } func cloneArgsForLFS() []string {