From a0b3ca6a30178023ec7e6cb0efc3c34aaa8a1b81 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 26 Aug 2024 18:44:55 +0900 Subject: [PATCH] bundle install with git repo needs to be run under the git environment --- spec/bundler/cache/git_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/bundler/cache/git_spec.rb b/spec/bundler/cache/git_spec.rb index cbd755872c9af3..8958916fecf3bc 100644 --- a/spec/bundler/cache/git_spec.rb +++ b/spec/bundler/cache/git_spec.rb @@ -294,6 +294,8 @@ FileUtils.mkdir_p bundled_app("vendor/cache") FileUtils.cp_r git_path, bundled_app("vendor/cache/foo-1.0-#{path_revision}") FileUtils.rm_rf bundled_app("vendor/cache/foo-1.0-#{path_revision}/.git") + # bundle install with git repo needs to be run under the git environment. + Dir.chdir(bundled_app) { system(*%W[git init --quiet]) } bundle :install, env: { "BUNDLE_DEPLOYMENT" => "true", "BUNDLE_CACHE_ALL" => "true" } end