op: point git-lfs config at the vendored binary (#38775)

git-lfs is vendored in the venv, but `git lfs install` writes filters and hooks that invoke a bare `git-lfs`, which is only on PATH inside the venv. With filter.lfs.required set, any checkout from a plain shell fails.

git runs filters and hooks from the worktree root, so a relative path into the venv resolves from anywhere.
This commit is contained in:
Trey Moen
2026-09-04 21:09:40 -07:00
committed by GitHub
parent 69ad376fef
commit c8603fb3ce
+6
View File
@@ -222,6 +222,12 @@ EOF
echo "Pulling git lfs files..."
st="$(date +%s)"
git config --local filter.lfs.clean ".venv/bin/git-lfs clean -- %f"
git config --local filter.lfs.smudge ".venv/bin/git-lfs smudge -- %f"
git config --local filter.lfs.process ".venv/bin/git-lfs filter-process"
git config --local filter.lfs.required true
printf '#!/bin/sh\nexec .venv/bin/git-lfs pre-push "$@"\n' > "$(git rev-parse --git-path hooks)/pre-push"
chmod +x "$(git rev-parse --git-path hooks)/pre-push"
if ! retry 3 git lfs pull; then
echo -e "[${RED}${NC}] Pulling git lfs files failed!"
return 1