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:
parent
b6c082fd09
commit
8adc606271
Notes:
git
2021-08-31 19:07:16 +09:00
2 changed files with 13 additions and 1 deletions
|
@ -192,7 +192,8 @@ module Bundler
|
||||||
|
|
||||||
if use_git
|
if use_git
|
||||||
Bundler.ui.info "Initializing git repo in #{target}"
|
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
|
config[:git_default_branch] = File.read("#{target}/.git/HEAD").split("/").last.chomp
|
||||||
end
|
end
|
||||||
|
|
|
@ -52,6 +52,17 @@ RSpec.describe "bundle gem" do
|
||||||
gem_skeleton_assertions
|
gem_skeleton_assertions
|
||||||
expect(bundled_app("#{gem_name}/.git")).not_to exist
|
expect(bundled_app("#{gem_name}/.git")).not_to exist
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
shared_examples_for "--mit flag" do
|
shared_examples_for "--mit flag" do
|
||||||
|
|
Loading…
Add table
Reference in a new issue