NOTE: This always returns true. This is not the right answer to the question, even though it has been accepted….
You could always use word boundaries around the name like \< and \>, but instead let Git do the work for you:
if [ `git branch --list $branch_name` ]
then
echo "Branch name $branch_name already exists."
fi