cwd: git_root misses a worktree or submodule (.git file) when git cannot run
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 58/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- git, lua, neovim
- Área
- developer-experience, testing
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Lua
- Estrellas
- 3.2k
- Forks
- 223
- Merge medio
- 6 h 7 min
- PR fusionados (30 d)
- 210
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de coder/claudecode.nvim
-
needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
coder/claudecode.nvim#588 ·
Los mantenedores suelen responder en 1 día
-
needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
coder/claudecode.nvim#587 ·
Los mantenedores suelen responder en 1 día
-
bug needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
coder/claudecode.nvim#313 ·
Los mantenedores suelen responder en 1 día
-
needs-triage
Dificultad 4/5 3-5 días Aptitud para principiantes 56/100
coder/claudecode.nvim#590 ·
Los mantenedores suelen responder en 1 día
-
needs-triage
Dificultad 4/5 3-5 días Aptitud para principiantes 56/100
coder/claudecode.nvim#589 ·
Los mantenedores suelen responder en 1 día
Todos los issues de coder/claudecode.nvim
Issues similares
-
documentation night-shift
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
nvim-telescope/telescope.nvim#3718 ·
Los mantenedores suelen responder en 1 día
-
leatherworking is wrongAbiertobug discord guide:leatherworking locale:enUS triage v0.3.6
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Seeking Caitlin (95737) should be a breadcrumb: still shown after the follow-up is completedAbiertoData Correction Forever
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día