git-checks 4.3.2

Checks to run against a topic in git to enforce coding standards.
Documentation
#!/bin/bash

set -e

readonly path="$1"
shift

if ! [ -f "format-config" ]; then
    echo >&2 'error: a `format-config` file is missing'
    exit 1
fi

if [ "$GIT_CHECKS_TEST_FORMATTING_ENV" != "check" ]; then
    echo >&2 "error: incorrect environment settings (\$GIT_CHECKS_TEST_FORMATTING_ENV=$GIT_CHECKS_TEST_FORMATTING_ENV)"
    exit 1
fi

while read old new; do
    [ -z "$old" ] && break
    sed -i -e "s/$old/$new/g" "$path"
done < "format-config"