#!/usr/bin/env sh

# Runs the `post-merge` board check for anyone pulling with rebase.
#
# `git pull` under `pull.rebase=true` runs `git rebase`, which fires this event
# and never `post-merge`. Without this the trigger is a silent no-op on that
# machine, which is the wrong failure mode for a hook whose whole purpose is to
# stop a shipped task being forgotten. The base stack ships both hooks to every
# target, where the pull style is not something this repository controls.
#
# Only the `rebase` argument delegates. `post-rewrite` also fires on
# `commit --amend`, which rewrites nothing on the board and would print the
# candidate list on an ordinary amend.

[ "$1" = "rebase" ] || exit 0

hook="$(dirname "$0")/post-merge"
[ -f "$hook" ] || exit 0

# shellcheck source=/dev/null
. "$hook"
