#!/bin/bash -e function run_test { if git rev-parse --verify HEAD >/dev/null 2>&1 ; then head="HEAD" else # First commit, use an empty tree head="4b825dc642cb6eb9a060e54bf8d69288fbee4904" fi git diff-index --check --cached "${head}" -- } case "${1}" in --about ) echo "Check for introduced trailing whitespace or an indent that uses a space before a tab." ;; * ) run_test ;; esac