#!/bin/sh
# --- pql plan rebuild (post-checkout) ---
# Auto-installed by pql init. On branch checkout (third arg == 1),
# rebuild pql.db from the changelog so the local cache reflects the
# new branch's planning state. File-level checkouts ($3 == 0) are
# skipped.
if [ "$3" = "1" ]; then
    echo "pql: rebuilding planning database from changelog..." >&2
    pql plan rebuild >/dev/null 2>&1 || true
fi
# --- end pql ---
