I am having a trouble checking if a branch exists in a Jenkins job. My shell scripts is as follows:
set +e BRANCH_EXISTS=$(git ls-remote --quiet | grep -w $