aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/dev-cmd
diff options
context:
space:
mode:
authorJason Karns2016-08-19 15:59:55 -0400
committerJason Karns2016-08-19 15:59:55 -0400
commitf40fd1df90345eadf2b5f8eac69f0003617029d4 (patch)
tree0d2a31d3f8c938d0d0fd9ef6d24ce871f09a4750 /Library/Homebrew/dev-cmd
parent5d603c3e8f658d67bce9975de93ee5101d94d8f3 (diff)
downloadbrew-f40fd1df90345eadf2b5f8eac69f0003617029d4.tar.bz2
bump-formula-pr: return to starting branch
After branching, bumping, pushing, and pr-ing; return to whatever branch was originally checked out. In most cases, I'd imagine users to want to continue receiving tap updates from master. However, after using bump-formula-pr, the tap in which the formula was bumped is left on the working branch that was doing the bumping and pull-request. After opening the PR, we should return to whatever branch the user originally had checked out – most likely master. (But git allows us to just say "previous branch" by using `-`)
Diffstat (limited to 'Library/Homebrew/dev-cmd')
-rw-r--r--Library/Homebrew/dev-cmd/bump-formula-pr.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb
index d875e42ac..8c232e182 100644
--- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb
+++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb
@@ -147,6 +147,7 @@ module Homebrew
ohai "hub fork (to read $HUB_REMOTE)"
ohai "git push $HUB_REMOTE #{branch}:#{branch}"
ohai "hub pull-request --browse -m '#{formula.name} #{new_formula_version}#{devel_message}'"
+ ohai "git checkout -"
else
safe_system "git", "checkout", "-b", branch, "origin/master"
safe_system "git", "commit", "--no-edit", "--verbose",
@@ -159,6 +160,7 @@ module Homebrew
safe_system "git", "push", remote, "#{branch}:#{branch}"
safe_system "hub", "pull-request", "--browse", "-m",
"#{formula.name} #{new_formula_version}#{devel_message}\n\nCreated with `brew bump-formula-pr`."
+ safe_system "git", "checkout", "-"
end
end
end