summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Lerche <carllerche@mac.com>2010-08-04 17:52:28 -0700
committerCarl Lerche <carllerche@mac.com>2010-08-04 18:01:16 -0700
commita4437da475a0014d6349ba033aa19b44801708f2 (patch)
treebd4f86eb401e029c53294e4d0a50864acf9f8425
parent5d50aaf04b3ac8748b058d83537a46396927efbb (diff)
downloadbundler-a4437da475a0014d6349ba033aa19b44801708f2.tar.gz
Always specify the paths when running git operations. The application might move
-rw-r--r--lib/bundler/source.rb2
-rw-r--r--spec/install/git_spec.rb30
2 files changed, 31 insertions, 1 deletions
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb
index 82780cb86b..b5d8c06510 100644
--- a/lib/bundler/source.rb
+++ b/lib/bundler/source.rb
@@ -626,7 +626,7 @@ module Bundler
git %|clone --no-checkout "#{cache_path}" "#{path}"|
end
Dir.chdir(path) do
- git "fetch --force --quiet"
+ git "fetch --force --quiet '#{cache_path}'"
git "reset --hard #{revision}"
if @submodules
diff --git a/spec/install/git_spec.rb b/spec/install/git_spec.rb
index f6399288a1..7e9b35827c 100644
--- a/spec/install/git_spec.rb
+++ b/spec/install/git_spec.rb
@@ -66,6 +66,36 @@ describe "bundle install with git sources" do
out.should include("Source contains 'foo' at: 1.0")
end
+
+ it "still works after moving the application directory" do
+ bundle "install vendor"
+ FileUtils.mv bundled_app, tmp('bundled_app.bck')
+
+ Dir.chdir tmp('bundled_app.bck')
+ should_be_installed "foo 1.0"
+ end
+
+ it "can still install after moving the application directory" do
+ bundle "install vendor"
+ FileUtils.mv bundled_app, tmp('bundled_app.bck')
+
+ update_git "foo", "1.1", :path => lib_path("foo-1.0")
+
+ Dir.chdir tmp('bundled_app.bck')
+ gemfile tmp('bundled_app.bck/Gemfile'), <<-G
+ source "file://#{gem_repo1}"
+ git "#{lib_path('foo-1.0')}" do
+ gem 'foo'
+ end
+
+ gem "rack", "1.0"
+ G
+
+ bundle "update foo"
+
+ should_be_installed "foo 1.1", "rack 1.0"
+ end
+
end
describe "with an empty git block" do