Skip to content

fix(tests): make git test wrappers exec the real git binary - #310

Merged
furedea merged 1 commit into
mainfrom
fix/git-wrapper-shim
Oct 23, 2026
Merged

furedea merged 1 commit into
mainfrom
fix/git-wrapper-shim

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

概要

cleanup_worktrees のテストが置く git wrapper は,shutil.which("git") の結果を exec していた./usr/bin が先にある PATH ではそれが Xcode の shim になり,shim が PATH から git を探し直して wrapper を再び呼ぶため無限ループしていた.共通ヘルパー tests/runtime.py の real_git() が git --exec-path から本物の git を一度だけ割り出し,すべての wrapper がそれを exec する.本番コードは変更していない.

変更前後

変更前 変更後
wrapper が呼ぶ git shutil.which("git")(shim のことがある) real_git()(git --exec-path 配下の実体)
/usr/bin が先の PATH 約 15 件失敗 101 件 pass
nix が先の PATH 101 件 pass 101 件 pass

受け入れ条件

  • /usr/bin が先の PATH で test_cleanup_worktrees*.py が全件通る
  • nix の git が先の PATH でも通る
  • CI でも通る
  • 同じ wrapper のやり方をしている他のテストも直した(4 ファイル 6 箇所)

Closes #307

🤖 Generated with Claude Code

Resolve git once from git --exec-path so wrappers no longer re-enter the
Xcode shim through PATH and loop forever.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@furedea
furedea merged commit c7c92ca into main Oct 23, 2026
11 checks passed
@furedea
furedea deleted the fix/git-wrapper-shim branch October 23, 2026 11:36
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.

cleanup_worktrees のテストの git wrapper が,Xcode の git shim を掴むと無限ループする

1 participant