Class: FightClub::Rebaser

Inherits:
Object
  • Object
show all
Defined in:
lib/fight_club/rebaser.rb

Class Method Summary collapse

Class Method Details

.attempt_rebase(pr) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/fight_club/rebaser.rb', line 3

def self.attempt_rebase(pr)
  result = `#{FightClub.git_command} rebase origin/#{FightClub.config.master_branch}`

  if result.include? 'CONFLICT'
    Commenter.comment(pr, 'Your branch is currently conflicting with the target branch. Please resolve all merge conflicts and repush.')
    `#{FightClub.git_command} rebase --abort`

    return false
  end

  true
end