lib/stencil/merge.rb in stencil-0.1.3 vs lib/stencil/merge.rb in stencil-0.1.4
- old
+ new
@@ -34,15 +34,14 @@
progressive(path, branches, push)
end
Cmd.run path, "git checkout master"
end
- def upstream(name, commit=nil, branches=[])
+ def upstream(name, commit=nil, *branches)
# Project variables
project = Config.read[:projects][name]
- branch = Cmd.run(project[:path], "git branch").split
- branch = branch[branch.index('*') + 1]
+ branches = project[:branches] if branches.empty?
# Template variables
template = Config.read[:templates][project[:template].intern]
path = template[:path]
@@ -55,12 +54,9 @@
# Get last commit if none specified
unless commit
cmd = "git log HEAD~1..HEAD --pretty=format:'%H'"
commit = Cmd.run(template[:path], cmd).strip
end
-
- # Cherry pick into master if no branches specified
- branches = %w(master) if branches.empty?
# Cherry pick commit into branches
branches.each do |branch|
output = Cmd.run path, "git checkout #{branch}"
Msg.error(output) if output.downcase.include?('error')
\ No newline at end of file