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

Aperta
#22 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
git, python

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Python
Stelle
1
Fork
1
Merge medio
2h 28m
PR unite (30g)
6

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di JTHCode/secretguard

Tutte le issue di JTHCode/secretguard

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.