Mark Pitt
claude-skills
  1. claude-skills
  2. Developer environment
  3. git-protection
  4. scripts/_chain

A file in git-protection

scripts/_chain

Bash 10 lines 424 B
_chainBash, shown as text and never run
#!/usr/bin/env bash
# core.hooksPath replaces <repo>/.git/hooks, so every other client hook is a symlink to this
# script, which runs the repository's own hook of the same name if it exists.
name=$(basename "$0")
self=$(readlink -f "$0")
local_hook="$(git rev-parse --git-common-dir 2>/dev/null)/hooks/$name"
if [ -x "$local_hook" ] && [ "$(readlink -f "$local_hook")" != "$self" ]; then
  exec "$local_hook" "$@"
fi
exit 0