Skip to content

Commit

Permalink
Merge pull request #2240 from TheCakeIsNaOH/deep-copy
Browse files Browse the repository at this point in the history
(#2111) Deep copy config
  • Loading branch information
gep13 authored Apr 21, 2021
2 parents 9ae705d + 49df0c7 commit 3f52148
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/chocolatey/infrastructure.app/services/NugetService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ public virtual ConcurrentDictionary<string, PackageResult> install_run(Chocolate
uninstallSuccessAction: null,
addUninstallHandler: true);

var originalConfig = config;
var originalConfig = config.deep_copy();

foreach (string packageName in packageNames.or_empty_list_if_null())
{
Expand Down Expand Up @@ -614,7 +614,7 @@ public virtual ConcurrentDictionary<string, PackageResult> upgrade_run(Chocolate
set_package_names_if_all_is_specified(config, () => { config.IgnoreDependencies = true; });
config.IgnoreDependencies = configIgnoreDependencies;

var originalConfig = config;
var originalConfig = config.deep_copy();

foreach (string packageName in config.PackageNames.Split(new[] { ApplicationParameters.PackageNamesSeparator }, StringSplitOptions.RemoveEmptyEntries).or_empty_list_if_null())
{
Expand Down Expand Up @@ -890,7 +890,7 @@ public virtual ConcurrentDictionary<string, PackageResult> get_outdated(Chocolat
set_package_names_if_all_is_specified(config, () => { config.IgnoreDependencies = true; });
var packageNames = config.PackageNames.Split(new[] { ApplicationParameters.PackageNamesSeparator }, StringSplitOptions.RemoveEmptyEntries).or_empty_list_if_null().ToList();

var originalConfig = config;
var originalConfig = config.deep_copy();

foreach (var packageName in packageNames)
{
Expand Down Expand Up @@ -1357,7 +1357,7 @@ public virtual ConcurrentDictionary<string, PackageResult> uninstall_run(Chocola
config.ForceDependencies = false;
});

var originalConfig = config;
var originalConfig = config.deep_copy();

foreach (string packageName in config.PackageNames.Split(new[] { ApplicationParameters.PackageNamesSeparator }, StringSplitOptions.RemoveEmptyEntries).or_empty_list_if_null())
{
Expand Down

0 comments on commit 3f52148

Please sign in to comment.