diff options
-rw-r--r-- | lib/bundler/settings.rb | 20 | ||||
-rw-r--r-- | spec/bundler/commands/install_spec.rb | 10 |
2 files changed, 29 insertions, 1 deletions
diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb index 0dd92b1ad9..8885b22e08 100644 --- a/lib/bundler/settings.rb +++ b/lib/bundler/settings.rb @@ -46,6 +46,20 @@ module Bundler update_requires_all_flag ].freeze + REMEMBERED_KEYS = %w[ + bin + cache_all + clean + deployment + frozen + no_prune + path + shebang + path.system + without + with + ].freeze + NUMBER_KEYS = %w[ jobs redirect @@ -115,7 +129,7 @@ module Bundler end def set_command_option(key, value) - if Bundler.feature_flag.forget_cli_options? + if !is_remembered(key) || Bundler.feature_flag.forget_cli_options? temporary(key => value) value else @@ -374,6 +388,10 @@ module Bundler ARRAY_KEYS.include?(self.class.key_to_s(key)) end + def is_remembered(key) + REMEMBERED_KEYS.include?(self.class.key_to_s(key)) + end + def is_credential(key) key == "gem.push_key" end diff --git a/spec/bundler/commands/install_spec.rb b/spec/bundler/commands/install_spec.rb index 4456af2572..bed24f0618 100644 --- a/spec/bundler/commands/install_spec.rb +++ b/spec/bundler/commands/install_spec.rb @@ -1288,4 +1288,14 @@ RSpec.describe "bundle install with gem sources" do expect(err).to include("Could not find compatible versions") end end + + context "when --jobs option given" do + before do + install_gemfile "source \"#{file_uri_for(gem_repo1)}\"", :jobs => 1 + end + + it "does not save the flag to config" do + expect(bundled_app(".bundle/config")).not_to exist + end + end end |