Removed wildcards from branch name match.
Otherwise branches like 'fix/update-master-branch' will be protected as well.
This commit is contained in:
parent
730df27bc6
commit
e111b57a86
|
@ -4,7 +4,7 @@ PROTECTED_BRANCH="master"
|
||||||
REMOTE_REF=$(echo "$HUSKY_GIT_STDIN" | cut -d " " -f 3)
|
REMOTE_REF=$(echo "$HUSKY_GIT_STDIN" | cut -d " " -f 3)
|
||||||
|
|
||||||
if [ -n "$REMOTE_REF" ]; then
|
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)"
|
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
|
read -r PROCEED < /dev/tty
|
||||||
echo
|
echo
|
||||||
|
|
Loading…
Reference in New Issue