From 88966daee9ba8bf52b291a1cb1650e3da2f8f9b0 Mon Sep 17 00:00:00 2001 From: "Rai (Michael Pokorny)" Date: Tue, 24 Jun 2025 14:42:42 -0700 Subject: [PATCH] create-task-worktree.sh: install pre-commit hooks in new worktrees --- agentydragon/tasks/create-task-worktree.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/agentydragon/tasks/create-task-worktree.sh b/agentydragon/tasks/create-task-worktree.sh index 746e19684e..8e5d5c25e1 100755 --- a/agentydragon/tasks/create-task-worktree.sh +++ b/agentydragon/tasks/create-task-worktree.sh @@ -102,6 +102,12 @@ fi if [ ! -d "$worktree_path" ]; then echo "Creating worktree for $branch at $worktree_path" git worktree add "$worktree_path" "$branch" + # Install pre-commit hooks in the new worktree if pre-commit is available + if command -v pre-commit >/dev/null 2>&1; then + (cd "$worktree_path" && pre-commit install) + else + echo "Warning: pre-commit not found; skipping hook install in $worktree_path" + fi else echo "Worktree for $branch already exists at $worktree_path"