From f40fd1df90345eadf2b5f8eac69f0003617029d4 Mon Sep 17 00:00:00 2001 From: Jason Karns Date: Fri, 19 Aug 2016 15:59:55 -0400 Subject: [PATCH] bump-formula-pr: return to starting branch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 `-`) --- Library/Homebrew/dev-cmd/bump-formula-pr.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb index d875e42ace..8c232e182c 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