From 8c25557bf58be31d2136611bf9916a1d3e9f13f7 Mon Sep 17 00:00:00 2001 From: Peter Fabian Date: Tue, 14 Jul 2020 12:51:50 +0200 Subject: [PATCH] Fixed the test to actually catch master. --- bin/pre-push.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/pre-push.sh b/bin/pre-push.sh index 656042e3111..789c45d4e7b 100755 --- a/bin/pre-push.sh +++ b/bin/pre-push.sh @@ -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 [ "refs/heads/${PROTECTED_BRANCH}" == "$REMOTE_REF" ]; 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