#!/bin/sh
# Companion to scripts/pre-commit. Both are enabled per clone by tools/bundle.py
# (it sets `core.hooksPath scripts` on its first run).
#
# `git commit -- <pathspec>` (also how some IDEs commit a file selection) builds
# the commit from a temporary index. The pre-commit bump therefore lands in the
# commit, but the real index keeps the pre-bump blob and plugin.json is left
# looking modified. The real index cannot be updated during the commit because
# git holds index.lock, so refresh it here instead.
#
# Must never fail a commit that already succeeded.
git add -- plugin.json 2>/dev/null || true
exit 0
