lib/git_topic.rb
# Accept the branch currently being reviewed.
Accept the branch currently being reviewed.
Accept the branch currently being reviewed .
def accept  topic=nil, opts={}
      raise "Must be on a review branch." unless on_review_branch?
      raise "Working tree must be clean" unless working_tree_clean?
      user, topic           = user_topic_name( current_branch )
      local_review_branch   = current_branch
      ff_merge = git [
          "checkout master",
          "merge --ff-only #{local_review_branch}",
      ]
      unless ff_merge
        git "checkout #{local_review_branch}"
        raise "
          review branch is not up to date: merge not a fast-forward.  Either
          rebase or reject this branch.
        ".unindent
      end
      rem_review_branch   = find_remote_review_branch( topic ).gsub( %r{^origin/}, '' )
      git [
        "push origin master :refs/heads/#{rem_review_branch}",
        "branch -d #{local_review_branch}"
      ]
      report  "Accepted topic #{user}/#{topic}."
    end
def accept topic = nil , opts = { } raise "Must be on a review branch." unless on_review_branch? raise "Working tree must be clean" unless working_tree_clean? user , topic = user_topic_name ( current_branch ) local_review_branch = current_branch ff_merge = git [ "checkout master" , "merge --ff-only #{local_review_branch}" , ] unless ff_merge git "checkout #{local_review_branch}" raise "
          review branch is not up to date: merge not a fast-forward.  Either
          rebase or reject this branch.
        " . unindent end rem_review_branch = find_remote_review_branch ( topic ) . gsub ( %r{ ^origin/ } , '' ) git [ "push origin master :refs/heads/#{rem_review_branch}" , "branch -d #{local_review_branch}" ] report "Accepted topic #{user}/#{topic}." end
Accept the branch currently being reviewed.
Accept the branch currently being reviewed .
# switch to master # merge review branch, assuming FF # push master, destroy remote # destroy local
topic
opts