Permalink
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...
2 parents d042d37 + 332a17c commit 4108fbb2dc77b4b5b1bf71c369ae066f23ef104b @indirect indirect committed Jun 27, 2011
Showing with 6 additions and 3 deletions.
  1. +1 −1 lib/bundler/source.rb
  2. +5 −2 spec/cache/git_spec.rb
View
@@ -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
@@ -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

0 comments on commit 4108fbb

Please sign in to comment.