# File lib/chef/knife/core/cookbook_scm_repo.rb, line 121 def branch_exists?(branch_name) git("branch --no-color").stdout.lines.any? {|l| l =~ /\s#{Regexp.escape(branch_name)}(?:\s|$)/ } end