Skip to content

Commit

Permalink
Fixing Merge.upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
winton committed May 29, 2010
1 parent 6b54b20 commit 4570b01
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/stencil/merge.rb
Expand Up @@ -36,11 +36,10 @@ def template(path, push)
Cmd.run path, "git checkout master" Cmd.run path, "git checkout master"
end end


def upstream(name, commit=nil, branches=[]) def upstream(name, commit=nil, *branches)
# Project variables # Project variables
project = Config.read[:projects][name] project = Config.read[:projects][name]
branch = Cmd.run(project[:path], "git branch").split branches = project[:branches] if branches.empty?
branch = branch[branch.index('*') + 1]


# Template variables # Template variables
template = Config.read[:templates][project[:template].intern] template = Config.read[:templates][project[:template].intern]
Expand All @@ -58,9 +57,6 @@ def upstream(name, commit=nil, branches=[])
commit = Cmd.run(template[:path], cmd).strip commit = Cmd.run(template[:path], cmd).strip
end end


# Cherry pick into master if no branches specified
branches = %w(master) if branches.empty?

# Cherry pick commit into branches # Cherry pick commit into branches
branches.each do |branch| branches.each do |branch|
output = Cmd.run path, "git checkout #{branch}" output = Cmd.run path, "git checkout #{branch}"
Expand Down

0 comments on commit 4570b01

Please sign in to comment.