aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/resolver/git_set.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/resolver/git_set.rb')
-rw-r--r--lib/rubygems/resolver/git_set.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/rubygems/resolver/git_set.rb b/lib/rubygems/resolver/git_set.rb
index ed809c124f..1a2b230b80 100644
--- a/lib/rubygems/resolver/git_set.rb
+++ b/lib/rubygems/resolver/git_set.rb
@@ -46,6 +46,32 @@ class Gem::Resolver::GitSet < Gem::Resolver::Set
end
##
+ # Adds and returns a GitSpecification with the given +name+ and +version+
+ # which came from a +repository+ at the given +reference+. If +submodules+
+ # is true they are checked out along with the repository.
+ #
+ # This fills in the prefetch information as enough information about the gem
+ # is present in the arguments.
+
+ def add_git_spec name, version, repository, reference, submodules # :nodoc:
+ add_git_gem name, repository, reference, submodules
+
+ source = Gem::Source::Git.new name, repository, reference
+ source.root_dir = @root_dir
+
+ spec = Gem::Specification.new do |s|
+ s.name = name
+ s.version = version
+ end
+
+ git_spec = Gem::Resolver::GitSpecification.new self, spec, source
+
+ @specs[spec.name] = git_spec
+
+ git_spec
+ end
+
+ ##
# Finds all git gems matching +req+
def find_all req