Class: Capistrano::Deploy::SCM::GitLocal

Inherits:
Git
  • Object
show all
Defined in:
lib/capistrano/recipes/deploy/scm/git_local.rb

Overview

An SCM that works in tandem with the :remote_cache_from_local strategy to support git submodules being retrieved via the local SSH tunnel also. Does not currently support recursive submodules.

Instance Method Summary collapse

Instance Method Details

#checkout(revision, destination) ⇒ Object



11
12
13
14
# File 'lib/capistrano/recipes/deploy/scm/git_local.rb', line 11

def checkout(revision, destination)
  super_command = super
  super_with_submodules_if_enabled(super_command, destination)
end

#sync(revision, destination) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/capistrano/recipes/deploy/scm/git_local.rb', line 16

def sync(revision, destination)
  sync_command = super
  # Match remote URL to current repository setting — don't know why the base
  # Git SCM only does this when the remote is not "origin".
  sync_with_remote_set_url_command = [
    "cd #{destination}",
    "#{command} remote set-url #{origin} #{variable(:repository)}",
    sync_command
  ].join(' && ')

  super_with_submodules_if_enabled(sync_with_remote_set_url_command, destination)
end