#!/usr/bin/env bash
# Switching branches changes what the tree contains, so the index is per-ref
# until it is rebuilt. $3 is 1 for a branch checkout, 0 for a file checkout.
[ "${3:-0}" = "1" ] || exit 0
root="$(git rev-parse --show-toplevel)"
[ -x "$root/tools/codegraph-sync.sh" ] && exec "$root/tools/codegraph-sync.sh"
exit 0
