#!/bin/bash

# Runs any hooks in mic/git/hooks, and exits if any of them fail.
set -e

# This is necessary because the Emacs extensions don't set GIT_DIR.
if [ -z "$GIT_DIR" ]; then
  DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
  GIT_DIR="${DIR}/.."
fi
for hook in $GIT_DIR/../misc/git/hooks/*; do
  $hook
done
