Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

test(guardrails): 4 block-root-delete-target allowed-roots assertions fail on Windows Git Bash

Abierto
#6,627 1 comentario 0 reacciones 0 asignados Ver en GitHub

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
57/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
git, shell
Área
testing

Línea de trabajo

Start with section 2d of plugins/guardrails/hooks/block-root-delete-target.test.sh and compare its allowed-roots fixtures with the Windows Git Bash path behavior described in the issue. Check how the test derives relative paths and handles / under MSYS; the issue also points to hook behavior as an open question. Done when the four assertions behave appropriately on Windows without breaking the existing Linux suite.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

needs-human needs-triage

Problem

On Windows Git Bash, four assertions in plugins/guardrails/hooks/block-root-delete-target.test.sh (section 2d, allowed roots) fail. They fail the same way on origin/main (a1a836827) as on the #6542 branch, so the suite cannot go fully green locally on Windows. CI is Linux, and the Windows lane does not run this suite.

Failing assertions and output

FAIL: allowed roots: a relative root grants nothing (direct): expected exit 2, got 0
FAIL: allowed roots: a relative root grants nothing (dispatched): expected exit 2, got 0
FAIL: allowed roots: the root '/' does not allow a top-level path (direct): expected exit 2, got 0
FAIL: allowed roots: the root '/' does not allow a top-level path (dispatched): expected exit 2, got 0

Root-cause hypotheses (test fixtures, not the hook)

  1. a relative root grants nothing passes "${RDT_AR#/}" as a "relative" entry. On Windows, RDT_TOP comes from git rev-parse --show-toplevel, which returns the drive form (D:/worktrees/...). #/ therefore strips nothing, and the entry is a valid absolute root that correctly allows $RDT_AR/child. The test does not build a relative entry on this host. Evidence: git rev-parse --show-toplevel printed D:/worktrees/melodic-software-claude-code-plugins-fix-6542-allowed-roots-prefix.
  2. the root '/' does not allow a top-level path lists / and expects rm -rf /opt/rdt-allowed-x/y to stay refused. Under MSYS, / is the Git install directory (cygpath -m / prints C:/Program Files/Git/). That is not a filesystem root, so rdt_root_like does not drop the entry, and /opt/... lies strictly under it, so the delete is allowed.

Suggested fix

  • Build the relative entry from a path that is certainly relative on every host, e.g. strip the drive or leading slash with a host-aware helper.
  • Skip or re-target the / case on MSYS, where / is not the volume root.
  • Decide whether the hook should also refuse an entry spelled / on Windows. It names the Git install directory, which is probably never what a user means.

Related: #6020. Found while working #6542 (PR #6624).

Lenguaje dominante
Shell
Estrellas
22
Forks
2
Merge medio
5 h 15 min
PR fusionados (30 d)
833

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de melodic-software/claude-code-plugins

Todos los issues de melodic-software/claude-code-plugins

Issues similares

Más issues de Shell/Bash

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.