Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Checking out missing git repos (but not being installed) - Fixing #3981 #4357

Merged
merged 4 commits into from
Mar 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/bundler/definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ def missing_specs
missing
end

def missing_dependencies
missing = []
resolve.materialize(current_dependencies, missing)
missing
end

def requested_specs
@requested_specs ||= begin
groups = requested_groups
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def resolve_if_need(options)
local = Bundler.ui.silence do
begin
tmpdef = Definition.build(Bundler.default_gemfile, Bundler.default_lockfile, nil)
true unless tmpdef.new_platform? || tmpdef.missing_specs.any?
true unless tmpdef.new_platform? || tmpdef.missing_dependencies.any?
rescue BundlerError
end
end
Expand Down
26 changes: 26 additions & 0 deletions spec/install/git_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,31 @@
expect(out).to include("Using foo 1.0 from #{lib_path("foo")} (at master@#{revision_for(lib_path("foo"))[0..6]})")
should_be_installed "foo 1.0"
end

it "should check out git repos that are missing but not being installed" do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please also test that the repo is being checked out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is checking that the directory is present enough?
I added that.

build_git "foo"

gemfile <<-G
gem "foo", :git => "file://#{lib_path("foo-1.0")}", :group => :development
G

lockfile <<-L
GIT
remote: file://#{lib_path("foo-1.0")}
specs:
foo (1.0)

PLATFORMS
ruby

DEPENDENCIES
foo!
L

bundle "install --path=vendor/bundle --without development"

expect(out).to include("Bundle complete!")
expect(vendored_gems("bundler/gems/foo-1.0-#{revision_for(lib_path("foo-1.0"))[0..11]}")).to be_directory
end
end
end