lib/gitscape/base.rb in gitscape-1.4.0 vs lib/gitscape/base.rb in gitscape-1.4.1
- old
+ new
@@ -19,17 +19,10 @@
def branch_names
@repo.branches.map { |b| b.full }
end
- def checkout(branch_name)
- puts "--- Switching to branch '#{branch_name}' ---"
- `git checkout -b #{branch_name}`
-
- throw "!!! Failed to switch to branch #{branch_name} !!!" if current_branch_name != branch_name
- end
-
def git_working_copy_is_clean puts_changes=true
# Check if the working copy is clean, if not, exit
changes = `git status -uno --ignore-submodules=all --porcelain`
@@ -72,11 +65,11 @@
has_conflicts
end
def hotfix_start(hotfix_branch=nil)
- checkout "live"
+ puts `git checkout live`
if hotfix_branch.length == 0
exception_message = "*** Improper Usage ***\nExpected Usage: hotfix_start <hotfix_branch>"
raise exception_message
end
@@ -123,12 +116,13 @@
# Bail on failures
exit 1 if !$?.success?
raise "Merge on #{branch} has failed.\nResolve the conflicts and run the script again." if git_has_conflicts
- # If we just merged the live branch, tag this revision
+ # If we just merged the live branch, tag this revision, and push that tag to origin
if branch == "live"
`git tag live/i#{live_iteration}/#{hotfix_branch}`
+ `git push --tags`
end
end
# Checkout previous branch for user convenience