summaryrefslogtreecommitdiff
path: root/lib/bundler/cli
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2021-08-04 08:40:56 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-08-31 19:06:14 +0900
commit8adc606271210acad490e93c47c3e1501407fb27 (patch)
treeaeb33c52bbc6d22e2b9e8a3733d9bb65db0970c2 /lib/bundler/cli
parentb6c082fd0951d22bc63582283d19f7c970829628 (diff)
[rubygems/rubygems] Fix git repo initialization on a path with spaces
https://github.com/rubygems/rubygems/commit/a2d6e10192
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4789
Diffstat (limited to 'lib/bundler/cli')
-rw-r--r--lib/bundler/cli/gem.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/bundler/cli/gem.rb b/lib/bundler/cli/gem.rb
index c9794c4003..43c3321053 100644
--- a/lib/bundler/cli/gem.rb
+++ b/lib/bundler/cli/gem.rb
@@ -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