建议的 worktree 操作可能触发仓库配置的 Git hook
原文依据:1 处模板允许子代理执行 `git worktree add`。该 Git 操作在存在相应 hook 配置时可能运行本机脚本,而模板没有要求检查或禁用 hook。
受污染的本地仓库配置或 hook 可能借评审流程以评审者权限执行命令,访问其可用文件或凭据。
源码确实允许执行 `git worktree add`,但没有提供该仓库的 Git hook 配置、全局 hooksPath 设置或任何将被执行的脚本,因此无法从现有证据确认本机代码执行风险。若环境配置了适用于该操作的 hook,创建并检出 worktree 可能触发它;影响取决于该外部配置。用户可要求评审禁用 worktree 创建,或先确认仓库及全局 hook 配置。
这项判断针对展示的代码和适用条件,不表示风险已经实际发生。 Your review is read-only on this checkout. Do not mutate the working tree, the index, HEAD, or branch state in any way. Use tools like `git show`, `git diff`, and `git log` to inspect history. If you need a working copy of a different revision, check it out into a separate temporary directory (e.g. `git worktree add /tmp/review-[SHA] [SHA]`) — never move HEAD on this checkout.