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

Commit

Permalink
Quote all git paths, add a spec
Browse files Browse the repository at this point in the history
  • Loading branch information
indirect committed Mar 17, 2010
1 parent eedbe7b commit aa40749
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/bundler/source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -316,17 +316,17 @@ def cache_path
def cache
if cache_path.exist?
Bundler.ui.info "Updating #{uri}"
in_cache { git "fetch --quiet #{uri} master:master" }
in_cache { git "fetch --quiet '#{uri}' master:master" }
else
Bundler.ui.info "Fetching #{uri}"
FileUtils.mkdir_p(cache_path.dirname)
git "clone #{uri} #{cache_path} --bare --no-hardlinks"
git "clone '#{uri}' '#{cache_path}' --bare --no-hardlinks"
end
end

def checkout
unless File.exist?("#{path}/.git")
%x(git clone --no-checkout "file://#{cache_path}" #{path})
unless File.exist?(path.join(".git"))
git "clone --no-checkout '#{cache_path}' '#{path}'"
end
Dir.chdir(path) do
git "fetch --quiet"
Expand Down
10 changes: 10 additions & 0 deletions spec/install/git_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,14 @@
err.should include("fatal: 'omgomg'")
err.should include("fatal: The remote end hung up unexpectedly")
end

it "works when the gem path has spaces in it" do
build_git "foo", :path => lib_path('foo space-1.0')

install_gemfile <<-G
gem "foo", :git => "#{lib_path('foo space-1.0')}"
G

should_be_installed "foo 1.0"
end
end

0 comments on commit aa40749

Please sign in to comment.