From 97995a127077494b5da6301de62357804764cd00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= Date: Thu, 5 Oct 2017 20:46:51 -0500 Subject: [PATCH] fixes #148: use explicit matching to perform string matches --- gitflow-common | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gitflow-common b/gitflow-common index 332740533..3318291d4 100644 --- a/gitflow-common +++ b/gitflow-common @@ -51,7 +51,14 @@ escape() { # set logic has() { local item=$1; shift - echo " $@ " | grep -q " $(escape $item) " + for s in $@; do + if [ "$item" = "$s" ]; then + return 0 + fi + done + return 1 + # the following code has issues with + in the branch names + # echo " $@ " | grep -q " $(escape $item) " } # basic math