lib/socialcast-git-extensions/git.rb in socialcast-git-extensions-3.1.18 vs lib/socialcast-git-extensions/git.rb in socialcast-git-extensions-3.1.19

- old
+ new

@@ -8,13 +8,16 @@ def assert_not_protected_branch!(branch, action) raise "Cannot #{action} reserved branch" if reserved_branch?(branch) end def assert_in_last_known_good_staging(branch) - branches_in_last_known_staging = branches(:remote => true, :merged => "origin/#{last_known_good_staging_branch}") + refresh_branch_from_remote last_known_good_staging_branch + branches_in_last_known_staging = branches(:remote => true, :merged => true) unless branches_in_last_known_staging.include? branch raise "Cannot release #{branch} unless it has already been promoted separately to #{staging_branch} and the build has passed." end + ensure + run_cmd "git checkout #{branch}" end # lookup the current branch of the PWD def current_branch repo = Grit::Repo.new(Dir.pwd)