1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[rubygems/rubygems] Fix git repo initialization on a path with spaces

https://github.com/rubygems/rubygems/commit/a2d6e10192
This commit is contained in:
David Rodríguez 2021-08-04 08:40:56 +02:00 committed by Hiroshi SHIBATA
parent b6c082fd09
commit 8adc606271
Notes: git 2021-08-31 19:07:16 +09:00
2 changed files with 13 additions and 1 deletions

View file

@ -192,7 +192,8 @@ module Bundler
if use_git
Bundler.ui.info "Initializing git repo in #{target}"
`git init #{target}`
require "shellwords"
`git init #{target.to_s.shellescape}`
config[:git_default_branch] = File.read("#{target}/.git/HEAD").split("/").last.chomp
end

View file

@ -52,6 +52,17 @@ RSpec.describe "bundle gem" do
gem_skeleton_assertions
expect(bundled_app("#{gem_name}/.git")).not_to exist
end
context "on a path with spaces" do
before do
Dir.mkdir(bundled_app("path with spaces"))
end
it "properly initializes git repo", :readline do
bundle "gem #{gem_name}", :dir => bundled_app("path with spaces")
expect(bundled_app("path with spaces/#{gem_name}/.git")).to exist
end
end
end
shared_examples_for "--mit flag" do