The GitProxy is responsible to iteract with git repositories. All actions required by the Git source is encapsualted in this object.
# File lib/bundler/source/git/git_proxy.rb, line 48 def branch @branch ||= allowed_in_path do git("branch") =~ /^\* (.*)$/ && $1.strip end end
# File lib/bundler/source/git/git_proxy.rb, line 61 def checkout if path.exist? return if has_revision_cached? Bundler.ui.info "Updating #{uri}" in_path do git %fetch --force --quiet --tags #{uri_escaped} "refs/heads/*:refs/heads/*"| end else Bundler.ui.info "Fetching #{uri}" FileUtils.mkdir_p(path.dirname) clone_command = %clone #{uri_escaped} "#{path}" --bare --no-hardlinks| clone_command = "#{clone_command} --quiet" if Bundler.ui.quiet? git clone_command end end
# File lib/bundler/source/git/git_proxy.rb, line 54 def contains?(commit) allowed_in_path do result = git_null("branch --contains #{commit}") $? == 0 && result =~ /^\* (.*)$/ end end
# File lib/bundler/source/git/git_proxy.rb, line 77 def copy_to(destination, submodules=false) unless File.exist?(destination.join(".git")) FileUtils.mkdir_p(destination.dirname) FileUtils.rm_rf(destination) git %clone --no-checkout "#{path}" "#{destination}"| File.chmod((0777 & ~File.umask), destination) end SharedHelpers.chdir(destination) do git %fetch --force --quiet --tags "#{path}"| git "reset --hard #{@revision}" if submodules git "submodule update --init --recursive" end end end
Generated with the Darkfish Rdoc Generator 2.