Class: GitCommands::Pull

Inherits:
Command show all
Defined in:
lib/straight_line/common/git_commands/pull.rb

Overview

pull a branch from remote

Instance Attribute Summary

Attributes inherited from Command

#working_dir

Instance Method Summary collapse

Methods inherited from Command

#arg, from_file, #run, #run_sub_commands, #sub_command

Constructor Details

#initialize(branch) ⇒ Pull

Returns a new instance of Pull.



6
7
8
9
10
11
12
13
14
15
# File 'lib/straight_line/common/git_commands/pull.rb', line 6

def initialize(branch)
  super('git')
  arg 'checkout'
  arg branch
  pull_command = Command.new 'git'
  pull_command
    .arg('pull origin')
    .arg branch
  sub_command pull_command
end