Repository comparison

Updated Jul 21, 2026

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:

  1. The configured primary_remote, when set and present.
  2. origin, when present.
  3. The lexicographically first configured remote.
  4. 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.