There I have added branch 'chef-vendor-absent-new'And try to look for branch chef-vendor-absent. branch_exists? returns wrong true value.2011/5/6 Akzhan Abdulin < " target="_blank"> >
I have fixed server code and add spec for it. In original master branch this spec is failed.Mac-mini-Akzhan-Abdulin:chef akzhanabdulin$ spec spec/unit/knife/core/cookbook_scm_repo_spec.rb....F...........1)'Chef::Knife::CookbookSCMRepo determines if a the branch not exists correctly without substring search' FAILEDexpected true to be false./spec/unit/knife/core/cookbook_scm_repo_spec.rb:122:Finished in 0.015377 seconds16 examples, 1 failure2011/5/6 Mark J. Reed < " target="_blank"> >
I don't have the Chef server code in front of me, but are you sure it's calling include? on the individual strings rather than the whole list?The latter would seem to make more sense in this instance.["chef-vendor-rabbitmq_chef"].include?("chef-vendor-rabbitmq") => false--On Fri, May 6, 2011 at 9:12 AM, Ringo De Smet < " target="_blank"> > wrote:
Gents,
This is a bug in Chef, more specifically in CookbookSCMRepo.branch_exists?
In my case, I already had branch chef-vendor-rabbitmq_chef in my repo,
but now I wanted to add branch chef-vendor-rabbitmq. The
implementation checks the list of existing branches and matches using
the String.include? method, however:
"chef-vendor-rabbitmq_chef".include?("chef-vendor-rabbitmq") => true
Filed this ticket: CHEF-2314
Ringo
Mark J. Reed < " target="_blank"> >
Archive powered by MHonArc 2.6.16.