From 9e5a30cc24be5abdfeb3f919c2058f15c5f0d268 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 12 May 2026 04:28:19 +0000 Subject: [PATCH] ci: disable LFS smudge filters in pre-commit job pre-commit stashes unstaged changes, runs hooks, then pops the stash. When the runner's working tree has LFS pointer files but git's LFS smudge filter is configured (per .gitattributes), the stash/pop cycle reports a phantom diff against the binary content git thinks it should smudge, and the pop fails with "the patch applies to ... which does not match the current contents". All hooks themselves pass on this PR (validated locally and visible in the previous CI run for #10). Clearing the LFS filters locally for the pre-commit job removes the disagreement without mutating the repo or any LFS-tracked files. Co-Authored-By: Allaun Silverfox --- .github/workflows/math-check.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/math-check.yml b/.github/workflows/math-check.yml index 996ceb18..ae7eaf6e 100644 --- a/.github/workflows/math-check.yml +++ b/.github/workflows/math-check.yml @@ -142,6 +142,25 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + # We deliberately do not smudge LFS pointers here -- the pre-commit + # hooks never need the actual binary content, and pulling LFS would + # add noise. The next step disables the LFS smudge filters locally + # so pre-commit's stash/pop cycle does not trip over pointer files. + lfs: false + + - name: Disable LFS filters for pre-commit + # pre-commit stashes unstaged changes before running hooks and pops + # them back after. When the working tree contains LFS pointer files + # but Git's LFS smudge filter is configured (per .gitattributes), the + # stash/pop cycle reports a phantom diff against the binary content + # Git thinks it should smudge, and the pop fails. Clearing the + # filters locally for this job removes the disagreement without + # mutating the repository or any LFS-tracked files. + run: | + git config --local filter.lfs.smudge "" + git config --local filter.lfs.clean "" + git config --local filter.lfs.process "" + git config --local filter.lfs.required false - name: Setup Python 3.11 uses: actions/setup-python@v5