Skip to content

fix: skip LFS smudge during workspace clone - #149

Closed
lishuceo wants to merge 1 commit into
mainfrom
feat/claude-session-2c8aaa
Closed

fix: skip LFS smudge during workspace clone#149
lishuceo wants to merge 1 commit into
mainfrom
feat/claude-session-2c8aaa

Conversation

@lishuceo

Copy link
Copy Markdown
Owner

Summary

  • 含 Git LFS 的仓库(如 UrhoX)在创建工作区时 clone 失败,因为 bare cache 不含 LFS 对象,本地 clone 时 smudge filter 无法下载大文件
  • execFileSync 的 clone 环境变量中添加 GIT_LFS_SKIP_SMUDGE=1,跳过 LFS 文件下载
  • Claude 只需要源码不需要二进制资产,跳过不影响功能;如需要可后续 git lfs pull 按需拉取

Test plan

  • 新增单元测试验证 clone 环境变量包含 GIT_LFS_SKIP_SMUDGE=1
  • 全部 31 个 manager 测试通过
  • 手动验证 UrhoX 仓库 clone 成功(GIT_LFS_SKIP_SMUDGE=1 git clone ...

🤖 Generated with Claude Code

…repos

Repos with Git LFS (e.g., UrhoX) fail to clone because the bare cache
doesn't contain LFS objects and the local clone can't resolve them.
Setting GIT_LFS_SKIP_SMUDGE=1 skips LFS file download during clone,
which is fine since Claude only needs source code, not binary assets.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@claude

claude Bot commented Mar 12, 2026

Copy link
Copy Markdown

Claude finished @lishuceo's task in 49s —— View job


PR Review: fix: skip LFS smudge during workspace clone

  • Check for previous review comments (none found)
  • Read changed files and understand context
  • Post review summary

Approved — Clean, well-scoped fix.

What it does: Adds GIT_LFS_SKIP_SMUDGE=1 to the environment of the local git clone in manager.ts:155-158, preventing LFS smudge filter failures when cloning from the bare cache (which doesn't contain LFS objects).

Review notes:

  • Correct scope: The fix is only applied to the local clone in manager.ts, not to the bare clone in cache.ts. This is correct — bare clones (--bare) don't check out files, so LFS smudge doesn't run there.
  • ...process.env spread: Properly inherits the full parent environment, only overriding the single LFS variable. No risk of breaking other git operations.
  • Test coverage: New test verifies the env is set on the execFileSync call. Straightforward and sufficient.
  • No issues found with confidence ≥ 75.

Minimal, targeted fix with appropriate test coverage. LGTM.

@lishuceo lishuceo closed this Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant