Git checks: skip every global option before the subcommand, not just one `-C`

Abierto
#22 0 comentarios 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
76/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
git, python

Línea de trabajo

Start in tests/test_redteam.py and find the existing Git-check guard covered for add, commit, and push. Locate the implementation that parses the subcommand and working directory, then update it to skip Git global options and resolve repeated -C and --work-tree correctly. Add the blocked and allowed regression cases named in the issue, using fake paths only, and run that test file.

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

Descripción

enhancement

The Git checks on add, commit and push only run when the subcommand comes straight after git (or, once #19 is merged, after one -C <dir>). Any other global option before the subcommand skips them:

  • git -c core.autocrlf=false add -A
  • git -C a -C b add -A (git applies each -C in turn)
  • git --no-pager -C dir add -A
  • git --git-dir=dir/.git --work-tree=dir add -A

Done when

  • The guard walks past git's global options and finds the subcommand and the folder git will act on:
    • repeated -C resolve relative to each other
    • --work-tree sets the folder
    • -c, --no-pager and similar are skipped
  • Regression tests in tests/test_redteam.py cover a blocked and an allowed case for each, with fake values only.

Found while reviewing #19.


Generated by Claude Code

Lenguaje dominante
Python
Estrellas
1
Forks
1
Merge medio
2 h 28 min
PR fusionados (30 d)
6

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 JTHCode/secretguard

Todos los issues de JTHCode/secretguard

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.