By default, the hook compares the current repository state with origin/main
for quality checks. For origin/main, the hook verifies that the primary
remote exists and that the matching local remote-tracking ref is available.
The primary remote is selected in this order:
- The configured
primary_remote, when set and present. origin, when present.- The lexicographically first configured remote.
- No primary remote.
The hook fetches the configured base ref only when the ref is missing. Set
POST_TURN_ALWAYS_FETCH=1 to fetch every time before checking quality gates.
PR-base checks fetch their base branch when they have enough GitHub information
to evaluate the gate.
Changed files are collected from three sources:
- unstaged tracked changes,
- staged tracked changes,
- untracked, non-ignored files.
The comparison point is the merge-base between the configured base ref and
HEAD, not the base ref tip. This keeps feature branches with multiple commits
focused on the branch diff.