Class: Command::Fetch

Inherits:
Base
  • Object
show all
Includes:
FastForward, ReceiveObjects, RemoteClient
Defined in:
lib/command/fetch.rb

Constant Summary collapse

CAPABILITIES =
["ofs-delta"]
UPLOAD_PACK =
"git-upload-pack"

Constants included from RemoteClient

RemoteClient::REF_LINE, RemoteClient::ZERO_OID

Constants included from ReceiveObjects

ReceiveObjects::UNPACK_LIMIT

Instance Attribute Summary

Attributes inherited from Base

#status

Instance Method Summary collapse

Methods included from RemoteClient

#build_agent_command, #recv_references, #report_range_update, #report_ref_update, #show_ref_update, #ssh_command, #start_agent

Methods included from ReceiveObjects

#recv_packed_objects, #select_processor_class, #transfer_unpack_limit

Methods included from FastForward

#fast_forward?, #fast_forward_error

Methods inherited from Base

#execute, #initialize

Constructor Details

This class inherits a constructor from Command::Base

Instance Method Details

#define_optionsObject



20
21
22
23
24
25
26
# File 'lib/command/fetch.rb', line 20

def define_options
  @parser.on("-f", "--force") { @options[:force] = true }

  @parser.on "--upload-pack=<upload-pack>" do |uploader|
    @options[:uploader] = uploader
  end
end

#runObject



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/command/fetch.rb', line 28

def run
  configure
  start_agent("fetch", @uploader, @fetch_url, CAPABILITIES)

  recv_references
  send_want_list
  send_have_list
  recv_objects
  update_remote_refs

  exit (@errors.empty? ? 0 : 1)
end