From: Jakub Czajka Date: Mon, 20 Jul 2026 15:54:18 +0000 (+0000) Subject: [hooks] Allow git push from main project after merge. X-Git-Url: https://git.ekhem.eu.org/?a=commitdiff_plain;h=3961e3e65d15c2b3aaeccee72ba12862cb034ab0;p=guix.git [hooks] Allow git push from main project after merge. --- diff --git a/.claude/hooks/create-worktree b/.claude/hooks/create-worktree index 06cefb7..fc47c70 100755 --- a/.claude/hooks/create-worktree +++ b/.claude/hooks/create-worktree @@ -16,6 +16,17 @@ then exit 0 fi +# Exempt git push (needed from main project after merge). +if echo "$stdin" \ + | grep -q '"tool_name"[[:space:]]*:[[:space:]]*"Bash"' +then + cmd=$(echo "$stdin" \ + | sed -n 's/.*"command"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p') + case "$cmd" in + "git push"*) exit 0 ;; + esac +fi + # Deny if not in this session's worktree. if ! echo "$PWD" | grep -q "/worktrees/${CLAUDE_CODE_SESSION_ID}" then