class Bundler::GitSource

def download(spec)

def download(spec)
  # Nothing needed here
end

def gems

def gems
  unless location.directory?
    # Raise an error if the source should run in local mode,
    # but it has not been cached yet.
    if local
      raise SourceNotCached, "Git repository '#{@uri}' has not been cloned yet"
    end
    FileUtils.mkdir_p(location.dirname)
    Bundler.logger.info "Cloning git repository at: #{@uri}"
    `git clone #{@uri} #{location} --no-hardlinks`
    if @ref
      Dir.chdir(location) { `git checkout --quiet #{@ref}` }
    elsif @branch && @branch != "master"
      Dir.chdir(location) { `git checkout --quiet origin/#{@branch}` }
    end
  end
  super
end

def initialize(options)

def initialize(options)
  super
  @uri = options[:uri]
  @ref = options[:ref]
  @branch = options[:branch]
end

def location

def location
  # TMP HAX to get the *.gemspec reading to work
  repository.path.join('dirs', File.basename(@uri, '.git'))
end