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

Fix deploying packaged git gems without git (#2968) #2973

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/bundler/source/git/git_proxy.rb
Expand Up @@ -40,7 +40,7 @@ def initialize(path, uri, ref, revision=nil, &allow)
@ref = ref
@revision = revision
@allow = allow || Proc.new { true }
raise GitNotInstalledError.new unless Bundler.git_present?
raise GitNotInstalledError.new if allow? && !Bundler.git_present?
end

def revision
Expand Down
16 changes: 16 additions & 0 deletions spec/install/gemfile/git_spec.rb
Expand Up @@ -947,5 +947,21 @@
bundle "update", :env => {"PATH" => ""}
expect(out).to include("You need to install git to be able to use gems from git repositories. For help installing git, please refer to GitHub's tutorial at https://help.github.com/articles/set-up-git")
end

it "installs a packaged git gem successfully" do
build_git "foo"

install_gemfile <<-G
git "#{lib_path('foo-1.0')}" do
gem 'foo'
end
G
bundle "package --all"
simulate_new_machine

bundle "install", :env => {"PATH" => ""}, :exitstatus => true
expect(out).to_not include("You need to install git to be able to use gems from git repositories.")
expect(exitstatus).to be_zero
end
end
end