Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1253 from mtscout6/bundler

---

Work around File.basename not working on Windows network share paths like "\\Somewhere\gitrepo"
  • Loading branch information...
commit 4108fbb2dc77b4b5b1bf71c369ae066f23ef104b 2 parents d042d37 + 332a17c
@indirect indirect authored
Showing with 6 additions and 3 deletions.
  1. +1 −1  lib/bundler/source.rb
  2. +5 −2 spec/cache/git_spec.rb
View
2  lib/bundler/source.rb
@@ -585,7 +585,7 @@ def git(command)
end
def base_name
- File.basename(uri.sub(%r{^(\w+://)?([^/:]+:)},''), ".git")
+ File.basename(uri.sub(%r{^(\w+://)?([^/:]+:)?(//\w*/)?(\w*/)*},''),".git")
end
def shortref_for_display(ref)
View
7 spec/cache/git_spec.rb
@@ -4,6 +4,9 @@
source = Bundler::Source::Git.new("uri" => "git@github.com:bundler.git")
source.send(:base_name).should == "bundler"
end
-end
-
+ it "base_name should strip network share paths" do
+ source = Bundler::Source::Git.new("uri" => "//MachineName/ShareFolder")
+ source.send(:base_name).should == "ShareFolder"
+ end
+ end
Please sign in to comment.
Something went wrong with that request. Please try again.