class Bundler::Source::Git

def local_override!(path)

def local_override!(path)
  return false if local?
  original_path = path
  path = Pathname.new(path)
  path = path.expand_path(Bundler.root) unless path.relative?
  unless 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 run " \
      "`bundle config unset local.#{override_for(original_path)}` to remove the local override"
  end
  unless path.exist?
    raise GitError, "Cannot use local override for #{name} because #{path} " \
      "does not exist. Run `bundle config unset local.#{override_for(original_path)}` to remove the local override"
  end
  @local = true
  set_paths!(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, options)
  if current_branch != branch && !Bundler.settings[:disable_local_branch_check]
    raise GitError, "Local override for #{name} at #{path} is using branch " \
      "#{current_branch} but Gemfile specifies #{branch}"
  end
  changed = cached_revision && cached_revision != revision
  if !Bundler.settings[:disable_local_revision_check] && 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