summaryrefslogtreecommitdiff
path: root/lib/bundler/source.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/source.rb')
-rw-r--r--lib/bundler/source.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb
index c708791d48..aa05afa535 100644
--- a/lib/bundler/source.rb
+++ b/lib/bundler/source.rb
@@ -727,6 +727,11 @@ module Bundler
# so the Gemfile.lock always picks up the new revision.
@git_proxy = GitProxy.new(path, uri, ref)
+ if options["branch"] and git_proxy.branch != options["branch"]
+ raise GitError, "Local override for #{name} at #{path} is using branch " \
+ "#{git_proxy.branch} but Gemfile specifies #{options["branch"]}"
+ end
+
changed = cached_revision && cached_revision != git_proxy.revision
if changed && !git_proxy.contains?(cached_revision)