diff options
author | Alex Taylor <alexmctaylorpants@gmail.com> | 2017-04-21 10:15:35 -0700 |
---|---|---|
committer | Alex Taylor <alexmctaylorpants@gmail.com> | 2017-04-21 10:57:00 -0700 |
commit | 9be3a304359cd81956c14f33ab905084a128d866 (patch) | |
tree | 6e9748d28704262f733e5bff116d736d1518b3e0 | |
parent | 60fbceb1e3632cc5efbbd76a747726ee20347fb6 (diff) | |
download | bundler-9be3a304359cd81956c14f33ab905084a128d866.tar.gz |
Ensure pre-existing Git caches are updated from remote source
-rw-r--r-- | lib/bundler/source/git.rb | 2 | ||||
-rw-r--r-- | spec/cache/git_spec.rb | 27 |
2 files changed, 29 insertions, 0 deletions
diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb index 380b6933ca..da48d64439 100644 --- a/lib/bundler/source/git.rb +++ b/lib/bundler/source/git.rb @@ -105,6 +105,8 @@ module Bundler def unlock! git_proxy.revision = nil + options["revision"] = nil + @unlocked = true end diff --git a/spec/cache/git_spec.rb b/spec/cache/git_spec.rb index b256c8d90f..31b3816a3b 100644 --- a/spec/cache/git_spec.rb +++ b/spec/cache/git_spec.rb @@ -93,6 +93,33 @@ end expect(out).to eq("CACHE") end + it "tracks updates when specifying the gem" do + git = build_git "foo" + old_ref = git.ref_for("master", 11) + + install_gemfile <<-G + gem "foo", :git => '#{lib_path("foo-1.0")}' + G + + bundle "#{cmd} --all" + + update_git "foo" do |s| + s.write "lib/foo.rb", "puts :CACHE" + end + + ref = git.ref_for("master", 11) + expect(ref).not_to eq(old_ref) + + bundle "update foo" + + expect(bundled_app("vendor/cache/foo-1.0-#{ref}")).to exist + expect(bundled_app("vendor/cache/foo-1.0-#{old_ref}")).not_to exist + + FileUtils.rm_rf lib_path("foo-1.0") + run "require 'foo'" + expect(out).to eq("CACHE") + end + it "uses the local repository to generate the cache" do git = build_git "foo" ref = git.ref_for("master", 11) |