diff --git a/git-guards/scripts/main-branch-guard.py b/git-guards/scripts/main-branch-guard.py index 0bb334d..6ef542b 100755 --- a/git-guards/scripts/main-branch-guard.py +++ b/git-guards/scripts/main-branch-guard.py @@ -99,15 +99,15 @@ def main() -> None: if worktree_root and Path(worktree_root).name == "main": deny( f"BLOCKED: File '{file_path}' is in the main worktree. " - "Editing files on the main branch is not allowed.\n\n" + "Editing files in the main worktree is not allowed.\n\n" "Create a worktree using `/superpowers:using-git-worktrees`.", ) current_branch = get_current_branch(file_path) if current_branch == "main": deny( - f"BLOCKED: Current branch is 'main'. " - "Editing files on the main branch is not allowed.\n\n" + f"BLOCKED: File '{file_path}' is in the main worktree. " + "Editing files in the main worktree is not allowed.\n\n" "Create a worktree using `/superpowers:using-git-worktrees`.", ) diff --git a/git-guards/scripts/main-branch-guard.sh b/git-guards/scripts/main-branch-guard.sh index be4dc62..7e30761 100755 --- a/git-guards/scripts/main-branch-guard.sh +++ b/git-guards/scripts/main-branch-guard.sh @@ -34,7 +34,7 @@ if [[ -n "$worktree_root" ]] && [[ "$(basename "$worktree_root")" == "main" ]]; hookSpecificOutput: { hookEventName: "PreToolUse", permissionDecision: "deny", - permissionDecisionReason: ("BLOCKED: File '\''\($path)'\'' is in the main worktree. Editing files on the main branch is not allowed.\n\nCreate a worktree using `/superpowers:using-git-worktrees`.") + permissionDecisionReason: ("BLOCKED: File '\''\($path)'\'' is in the main worktree. Editing files in the main worktree is not allowed.\n\nCreate a worktree using `/superpowers:using-git-worktrees`.") } }' >&2 exit 2 @@ -48,7 +48,7 @@ if [[ "$current_branch" == "main" ]]; then hookSpecificOutput: { hookEventName: "PreToolUse", permissionDecision: "deny", - permissionDecisionReason: ("BLOCKED: Current branch is '\''main'\''. Editing files on the main branch is not allowed.\n\nCreate a worktree using `/superpowers:using-git-worktrees`.") + permissionDecisionReason: ("BLOCKED: File '\''\($path)'\'' is in the main worktree. Editing files in the main worktree is not allowed.\n\nCreate a worktree using `/superpowers:using-git-worktrees`.") } }' >&2 exit 2