Skip to content

fix(hooks): read the protected-branch check from the session cwd - #237

Merged
danielvm-git merged 2 commits into
mainfrom
fix/guard-hook-session-cwd
Nov 8, 2026
Merged

danielvm-git merged 2 commits into
mainfrom
fix/guard-hook-session-cwd

Conversation

@danielvm-git

Copy link
Copy Markdown
Owner

The protected-branch check in pre-tool-use.sh previously inspected the branch of the hook process itself, which could differ from the session working directory (for instance, when running in a git worktree). This updates the check to inspect the session cwd from the payload when present, with fallback to process cwd, and adds regression tests.

@danielvm-git
danielvm-git merged commit fe3fa3b into main Nov 8, 2026
5 checks passed
@danielvm-git
danielvm-git deleted the fix/guard-hook-session-cwd branch November 8, 2026 19:26
github-actions Bot pushed a commit that referenced this pull request Nov 8, 2026
## [2.95.2](v2.95.1...v2.95.2) (2026-11-08)

### Bug Fixes

* **hooks:** read protected-branch check from session cwd ([#237](#237)) ([fe3fa3b](fe3fa3b))
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 2.95.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant