зеркало из https://github.com/github/ruby.git
[rubygems/rubygems] Save array allocation for every dependency in Gemfile
Only need to check for lack of git key when branch option is present https://github.com/rubygems/rubygems/commit/ebfca1b389
This commit is contained in:
Родитель
ca7f7c0f51
Коммит
1cd4b59e8c
|
@ -404,13 +404,11 @@ module Bundler
|
|||
end
|
||||
|
||||
def validate_keys(command, opts, valid_keys)
|
||||
invalid_keys = opts.keys - valid_keys
|
||||
|
||||
git_source = opts.keys & @git_sources.keys.map(&:to_s)
|
||||
if opts["branch"] && !(opts["git"] || opts["github"] || git_source.any?)
|
||||
if opts["branch"] && !(opts["git"] || opts["github"] || (opts.keys & @git_sources.keys.map(&:to_s)).any?)
|
||||
raise GemfileError, %(The `branch` option for `#{command}` is not allowed. Only gems with a git source can specify a branch)
|
||||
end
|
||||
|
||||
invalid_keys = opts.keys - valid_keys
|
||||
return true unless invalid_keys.any?
|
||||
|
||||
message = String.new
|
||||
|
|
Загрузка…
Ссылка в новой задаче