#!/usr/bin/env bash

# Reject commits directly to 'master' to encourage use of topic branches.
if test -z "$HOOKS_ALLOW_COMMIT_MASTER"; then
  if git symbolic-ref HEAD | egrep -q '^refs/heads/master$'; then
    echo 'Please do not commit directly to "master".  Create a topic instead:

 git checkout -b my-topic
 git commit
'
    exit 1
  fi
fi
