cwd: git_root misses a worktree or submodule (.git file) when git cannot run
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 58/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- git, lua, neovim
調査の方向性
Start with the fallback walk in lua/claudecode/cwd.lua and the existing no-git cases in tests/integration/cwd_path_characters_spec.lua. Add worktree and submodule cases created with real git, then look them up with git off PATH; update the README wording and clean up the specified tests/unit/cwd_spec.lua helpers. Run check.sh and --record; done when the no-git lookups return the worktree root and all checks pass.
索引モデルが issue の本文から書いたものです。
説明
cwd.git_root misses a git worktree or a submodule when git cannot run.
Defect. When git is missing from PATH or fails, the fallback walk in lua/claudecode/cwd.lua tests vim.fn.isdirectory(dir .. "/.git"). A worktree or a submodule has a .git file (gitdir: ...), so the walk skips it and returns nil, or a repository above it. With git, the answer is the worktree folder.
Reproduction (on main, Neovim 0.12.3 and 0.8.0):
git init main && git -C main commit --allow-empty -m i
git -C main worktree add ../wt && mkdir wt/sub
Run require("claudecode.cwd").git_root("<R>/wt") and git_root("<R>/wt/sub") once with git on PATH and once with PATH set to an empty folder (vim.o.shell = "/bin/sh"). With git: <R>/wt for both. Without git: nil for both.
Fix. In the walk, also accept vim.fn.filereadable(dir .. "/.git") == 1. Say "a .git folder or file" in lua/claudecode/README.md. Add worktree and submodule cases to the no-git mode of tests/integration/cwd_path_characters_spec.lua (create them with real git, look them up with git off PATH). cwd.lua is covered by verify-diff-lifecycle, so run the full check.sh and --record.
Test cleanup in the same PR (tests/unit/cwd_spec.lua):
- Lines 46 and 57 use
assert(os.execute("mkdir -p ...")). That never fails under LuaJIT, becauseos.executereturns 0 or 256 and both are truthy (#570 fixed the same bug in two other files). Checkstatus == 0 or status == true, and move #570's localshellhelper totests/helpers/. saved.finddiris saved (line 25) and restored (line 30), but nothing stubsfinddirsince #561. Delete both uses.
Related: the symlink walk issue filed next to this one touches the same walk; do both in one PR or this one first.
Owner: the next maintainer pass on cwd.lua. Deferred from the README verification run with the maintainer's agreement.
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high
- 主要言語
- Lua
- スター
- 3.2k
- フォーク
- 223
- 平均マージ
- 6時間 7分
- マージ済み PR(30日)
- 210
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
coder/claudecode.nvim のほかの issue
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
coder/claudecode.nvim#588 ·
メンテナーはふだん 1 日以内に返信
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
coder/claudecode.nvim#587 ·
メンテナーはふだん 1 日以内に返信
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
coder/claudecode.nvim#313 ·
メンテナーはふだん 1 日以内に返信
-
needs-triage
難易度 4/5 3〜5日 初心者へのやさしさ 56/100
coder/claudecode.nvim#590 ·
メンテナーはふだん 1 日以内に返信
-
needs-triage
難易度 4/5 3〜5日 初心者へのやさしさ 56/100
coder/claudecode.nvim#589 ·
メンテナーはふだん 1 日以内に返信
coder/claudecode.nvim の issue をすべて見る
似ている issue
-
documentation night-shift
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
nvim-telescope/telescope.nvim#3718 ·
メンテナーはふだん 1 日以内に返信
-
bug discord guide:leatherworking locale:enUS triage v0.3.6
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
Data Correction Forever
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 1 日以内に返信