Merge pull request #757 from jasonkarns/bump-formula-pr-upstream

bump-formula-pr now creates non-tracking branches
This commit is contained in:
Martin Afanasjew 2016-08-20 11:35:08 +02:00 committed by GitHub
commit 27d9e450ff

View File

@ -140,15 +140,15 @@ module Homebrew
formula.path.parent.cd do
branch = "#{formula.name}-#{new_formula_version}"
if ARGV.dry_run?
ohai "git checkout -b #{branch} origin/master"
ohai "git checkout --no-track -b #{branch} origin/master"
ohai "git commit --no-edit --verbose --message='#{formula.name} #{new_formula_version}#{devel_message}' -- #{formula.path}"
ohai "hub fork --no-remote"
ohai "hub fork"
ohai "hub fork (to read $HUB_REMOTE)"
ohai "git push $HUB_REMOTE #{branch}:#{branch}"
ohai "git push --set-upstream $HUB_REMOTE #{branch}:#{branch}"
ohai "hub pull-request --browse -m '#{formula.name} #{new_formula_version}#{devel_message}'"
else
safe_system "git", "checkout", "-b", branch, "origin/master"
safe_system "git", "checkout", "--no-track", "-b", branch, "origin/master"
safe_system "git", "commit", "--no-edit", "--verbose",
"--message=#{formula.name} #{new_formula_version}#{devel_message}",
"--", formula.path
@ -156,7 +156,7 @@ module Homebrew
quiet_system "hub", "fork"
remote = Utils.popen_read("hub fork 2>&1")[/fatal: remote (.+) already exists\./, 1]
odie "cannot get remote from 'hub'!" if remote.to_s.empty?
safe_system "git", "push", remote, "#{branch}:#{branch}"
safe_system "git", "push", "--set-upstream", remote, "#{branch}:#{branch}"
safe_system "hub", "pull-request", "--browse", "-m",
"#{formula.name} #{new_formula_version}#{devel_message}\n\nCreated with `brew bump-formula-pr`."
end