Class: GitCommands::Rebase

Inherits:
Command
  • Object
show all
Includes:
GitCommands
Defined in:
lib/straight_line/common/git_commands/rebase.rb

Overview

Rebase a branch to a base

Instance Attribute Summary

Attributes inherited from Command

#working_dir

Instance Method Summary collapse

Methods included from GitCommands

#handle_merge_conflict

Methods inherited from Command

#arg, from_file, #run_sub_commands, #sub_command

Constructor Details

#initialize(base, branch) ⇒ Rebase

Returns a new instance of Rebase.



9
10
11
12
13
14
# File 'lib/straight_line/common/git_commands/rebase.rb', line 9

def initialize(base, branch)
  super('git')
  arg 'rebase'
  arg base
  arg branch
end

Instance Method Details

#run(*_args) ⇒ Object



16
17
18
19
20
# File 'lib/straight_line/common/git_commands/rebase.rb', line 16

def run(*_args)
  super true
rescue ShellError => e
  handle_merge_conflict(e)
end