diff --git a/git/git-cherry-move b/git/git-cherry-move index fa854c8..11dc3fd 100755 --- a/git/git-cherry-move +++ b/git/git-cherry-move @@ -16,8 +16,7 @@ set -e assert_branch_exists() { - RET=$(git branch | sed --quiet "s/^\*\? \+${1}$/${1}/p") - if [ "$RET" != $1 ] ; then + if ! git for-each-ref refs/heads | grep "/${1}$" >/dev/null ; then echo "The branch $1 does not exist!" exit 2 fi