vendor/cache/ruby/2.3.0/gems/capistrano-2.9.0/lib/capistrano/recipes/deploy/scm/git.rb
# Merges the changes to 'head' since the last fetch, for remote_cache
# deployment strategy
Merges the changes to 'head' since the last fetch, for remote_cache
deployment strategy
Merges the changes to ' head ' since the last fetch for remote_cache deployment strategy
def sync(revision, destination)
          git     = command
          remote  = origin
          execute = []
          execute << "cd #{destination}"
          if remote != 'origin'
            execute << "#{git} config remote.#{remote}.url #{variable(:repository)}"
            execute << "#{git} config remote.#{remote}.fetch +refs/heads/*:refs/remotes/#{remote}/*"
          end
          execute << "#{git} fetch #{verbose} #{remote} && #{git} fetch --tags #{verbose} #{remote} && #{git} reset #{verbose} --hard #{revision}"
          if variable(:git_enable_submodules)
            execute << "#{git} submodule #{verbose} init"
            execute << "for mod in `#{git} submodule status | awk '{ print $2 }'`; do #{git} config -f .git/config submodule.${mod}.url `#{git} config -f .gitmodules --get submodule.${mod}.url` && echo Synced $mod; done"
            execute << "#{git} submodule #{verbose} sync"
            if false == variable(:git_submodules_recursive)
              execute << "#{git} submodule #{verbose} update --init"
            else
              execute << %Q(export GIT_RECURSIVE=$([ ! "`#{git} --version`" \\< "git version 1.6.5" ] && echo --recursive))
              execute << "#{git} submodule #{verbose} update --init $GIT_RECURSIVE"
            end
          end
          execute << "#{git} clean #{verbose} -d -x -f"
          execute.join(" && ")
        end
def sync ( revision , destination ) git = command remote = origin execute = [ ] execute << "cd #{destination}" if remote != 'origin' execute << "#{git} config remote.#{remote}.url #{variable(:repository)}" execute << "#{git} config remote.#{remote}.fetch +refs/heads/*:refs/remotes/#{remote}/*" end execute << "#{git} fetch #{verbose} #{remote} && #{git} fetch --tags #{verbose} #{remote} && #{git} reset #{verbose} --hard #{revision}" if variable ( :git_enable_submodules ) execute << "#{git} submodule #{verbose} init" execute << "for mod in `#{git} submodule status | awk '{ print $2 }'`; do #{git} config -f .git/config submodule.${mod}.url `#{git} config -f .gitmodules --get submodule.${mod}.url` && echo Synced $mod; done" execute << "#{git} submodule #{verbose} sync" if false == variable ( :git_submodules_recursive ) execute << "#{git} submodule #{verbose} update --init" else execute << %Q(export GIT_RECURSIVE=$([ ! "`#{git} --version`" \\< "git version 1.6.5" ] && echo --recursive)) execute << "#{git} submodule #{verbose} update --init $GIT_RECURSIVE" end end execute << "#{git} clean #{verbose} -d -x -f" execute . join ( " && " ) end
Merges the changes to 'head' since the last fetch, for remote_cache
deployment strategy
Merges the changes to ' head ' since the last fetch for remote_cache deployment strategy
# Use git-config to setup a remote tracking branches. Could use # git-remote but it complains when a remote of the same name already # exists, git-config will just silenty overwrite the setting every # time. This could cause wierd-ness in the remote cache if the url # changes between calls, but as long as the repositories are all # based from each other it should still work fine. # since we're in a local branch already, just reset to specified revision rather than merge # Make sure there's nothing else lying around in the repository (for # example, a submodule that has subsequently been removed).
revision
<not_specific>
destination
<not_specific>