Skip to content

Commit

Permalink
provide a fetch-pull merge alternative
Browse files Browse the repository at this point in the history
add merge, rebase and do-nothing options to the fetch-pull command.  i
like being able to fetch a pull request by number, but sometimes i'd
rather not have the rebase happen automatically.
  • Loading branch information
nixon committed Jun 28, 2011
1 parent df4faeb commit d09ed2f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/commands/commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,9 @@
end
end

desc "Fetch a specified pull request and rebase it to the current tip"
usage "github fetch-pull [pullRequestId]"
command :'fetch-pull' do |n|
desc "Fetch a pull request and possibly rebase or merge it to the current tip"
usage "github fetch-pull [pullRequestId] [rebase | merge]"
command :'fetch-pull' do |n,action|
user, repo = nil,nil
# figure out the user+repo name from git-remote
git("remote -v").split("\n").each do |line|
Expand Down Expand Up @@ -299,5 +299,5 @@
end
pgit "fetch #{repo_url}.git #{head['ref']}:pull-#{n}"
pgit "checkout pull-#{n}"
pgit "rebase #{tip}"
pgit "#{action} #{tip}" if ["rebase", "merge"].include?(action)
end

0 comments on commit d09ed2f

Please sign in to comment.