method
local_override!
v2_6_3 -
Show latest stable
-
0 notes -
Class: Git
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125
- 1_9_3_392
- 2_1_10
- 2_2_9
- 2_4_6
- 2_5_5
- 2_6_3 (0)
- What's this?
local_override!(path)
public
Hide source
# File lib/bundler/source/git.rb, line 118 def local_override!(path) return false if local? path = Pathname.new(path) path = path.expand_path(Bundler.root) unless path.relative? unless options["branch"] || Bundler.settings[:disable_local_branch_check] raise GitError, "Cannot use local override for #{name} at #{path} because " ":branch is not specified in Gemfile. Specify a branch or use " "`bundle config --delete` to remove the local override" end unless path.exist? raise GitError, "Cannot use local override for #{name} because #{path} " "does not exist. Check `bundle config --delete` to remove the local override" end set_local!(path) # Create a new git proxy without the cached revision # so the Gemfile.lock always picks up the new revision. @git_proxy = GitProxy.new(path, uri, ref) if git_proxy.branch != options["branch"] && !Bundler.settings[:disable_local_branch_check] 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 && !@unlocked && !git_proxy.contains?(cached_revision) raise GitError, "The Gemfile lock is pointing to revision #{shortref_for_display(cached_revision)} " "but the current branch in your local override for #{name} does not contain such commit. " "Please make sure your branch is up to date." end changed end