#!/bin/bash
# pre-commit script
protected_branches="$@"
branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
for protected_branch in $protected_branches; do
if [ "$branch" = "$protected_branch" ]; then
echo "Direct commits to the '$protected_branch' branch are not allowed."
exit 1
fi
done