lib/gitscape/base.rb in gitscape-1.3 vs lib/gitscape/base.rb in gitscape-1.3.1
- old
+ new
@@ -74,11 +74,14 @@
raise exception_message
end
hotfix_branch_name = "hotfix/#{hotfix_branch_name}"
puts "Creating hotfix branch '#{hotfix_branch_name}'..."
- @repo.checkout(@repo.branch(hotfix_branch_name).create)
+
+ hotfix_branch = @repo.branch(hotfix_branch_name)
+ `git checkout -b #{hotfix_branch.full}`
+ @repo.checkout(hotfix_branch)
end
def hotfix_finish(hotfix_branch_name=nil)
# TODO:
# 1. Tag the new live revision with 'live/<branch_name_without_prefix>'
@@ -95,23 +98,25 @@
unless @repo.branches.include? hotfix_branch_name
end
merge_master = true
+ master_branch = @repo.branch "master"
if hotfix_branch_name.empty?
puts "!!! not currently on a hotfix branch, and no branch name was provided as an argument !!!"
puts usage_string
exit 1
end
hotfix_branch = @repo.branch hotfix_branch_name
development_branch = @repo.branches.select {|branch| branch.full.start_with? "release/"}.sort.last
- development_branch = @repo.branch "master" if development_branch == nil
+ development_branch = master_branch if development_branch == nil
live_branch = @repo.branch "live"
# Collect the set of branches we'd like to merge the hotfix into
merge_branches = [development_branch, live_branch]
+ merge_branches.insert master_branch if !(merge_branches.include? master_branch) && merge_master
# Merge the hotfix into branches
for branch in merge_branches
merge_options = @merge_options
merge_options += " --log" if branch == "master"