Removed wildcards from branch name match.

Otherwise branches like 'fix/update-master-branch' will be protected as well.
This commit is contained in:
Peter Fabian 2020-07-13 15:04:45 +02:00
parent 730df27bc6
commit e111b57a86
1 changed files with 1 additions and 1 deletions

View File

@ -4,7 +4,7 @@ PROTECTED_BRANCH="master"
REMOTE_REF=$(echo "$HUSKY_GIT_STDIN" | cut -d " " -f 3)
if [ -n "$REMOTE_REF" ]; then
if [ -z "${REMOTE_REF##*$PROTECTED_BRANCH*}" ]; then
if [ -z "${REMOTE_REF##$PROTECTED_BRANCH}" ]; then
printf "%sYou're about to push to master, is that what you intended? [y/N]: %s" "$(tput setaf 3)" "$(tput sgr0)"
read -r PROCEED < /dev/tty
echo