fix(agents-init): address final review issues (CLAUDE.md safety, rm-rf guard, gitignore anchoring, worktree detection)

This commit is contained in:
2026-06-12 22:09:44 -04:00
parent 11dc584104
commit 45cba3a15b
2 changed files with 14 additions and 16 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ function _agents_init_ensure_gitignore
# Prefer git check-ignore (respects wildcards, parent globs, negations).
# --no-index lets it evaluate non-existent paths.
set -l already_ignored 0
if test -d "$root/.git"
if git -C "$root" rev-parse --git-dir >/dev/null 2>&1
git -C "$root" check-ignore -q --no-index "$pattern" 2>/dev/null
and set already_ignored 1
else if test -f "$gitignore"