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

未关闭
#22 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
76/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
git, python

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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

主要语言
Python
星标
1
派生
1
平均合并
2 小时 28 分钟
30 天内合并 PR
6

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

JTHCode/secretguard 的其他 Issue

查看 JTHCode/secretguard 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。