diff options
author | José Valim <jose.valim@plataformatec.com.br> | 2012-07-17 09:19:57 +0200 |
---|---|---|
committer | José Valim <jose.valim@plataformatec.com.br> | 2012-07-17 09:53:39 +0200 |
commit | 51aaf18a0e2d8a76a44f789d0e31b4d2ce123024 (patch) | |
tree | a7aa34c6799c4ea58081b528124c67fa15501f63 /lib/bundler/source.rb | |
parent | 438ef20987951883cb5837d245eac9c517848b2d (diff) | |
download | bundler-51aaf18a0e2d8a76a44f789d0e31b4d2ce123024.tar.gz |
Don't actually care if git repo is inside the repository, always cache it, closes #1989
Diffstat (limited to 'lib/bundler/source.rb')
-rw-r--r-- | lib/bundler/source.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb index 10ade87d..e4117dd1 100644 --- a/lib/bundler/source.rb +++ b/lib/bundler/source.rb @@ -694,6 +694,9 @@ module Bundler File.basename(@uri, '.git') end + # This is the path which is going to contain a specific + # checkout of the git repository. When using local git + # repos, this is set to the local repo. def install_path @install_path ||= begin git_scope = "#{base_name}-#{shortref_for_path(revision)}" @@ -778,7 +781,7 @@ module Bundler def cache(spec) return unless Bundler.settings[:cache_all] - return if path.expand_path(Bundler.root).to_s.index(Bundler.root.to_s) == 0 + return if path == app_cache_path cached! FileUtils.rm_rf(app_cache_path) git_proxy.checkout if requires_checkout? @@ -792,6 +795,10 @@ module Bundler raise GitError, "#{to_s} is not checked out. Please run `bundle install`" end + # This is the path which is going to contain a cache + # of the git repository. When using the same git repository + # across different projects, this cache will be shared. + # When using local git repos, this is set to the local repo. def cache_path @cache_path ||= begin git_scope = "#{base_name}-#{uri_hash}" |