Module: Git::Trac::Runner::Fetchable

Included in:
Checkout, Fetch
Defined in:
lib/git/trac/runner.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#add_options(opts) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/git/trac/runner.rb', line 29

def add_options(opts)
  super
  opts.on("--against BRANCH","apply against branch BRANCH") do |b|
    options[:upstream] = b
  end
  opts.on("--depth NUM","search depth (see git-trac help apply)") do |n|
    options[:depth] = n
  end
  opts.on("--root DIR","apply patches relative to DIR") do |dir|
    options[:root] = dir
  end
  add_local_option(opts)
end

#after_fetch(attachment) ⇒ Object



53
54
# File 'lib/git/trac/runner.rb', line 53

def after_fetch(attachment)
end

#runObject



43
44
45
46
47
48
49
50
51
# File 'lib/git/trac/runner.rb', line 43

def run
  options[:upstream] ||= repository.guess_upstream || "refs/remotes/trunk"
  fetch_unless_local
  attachment = one_attachment
  fetch_or_abort(attachment)
  repository.in_work_tree do
    after_fetch(attachment)
  end
end