Skip to content

Commit 7f885b2

Browse files
authored
case insensitive system-wide NuGet config merging (#700)
make the merging of system-wide NuGet config package credentials introduced in #678 case insensitive
1 parent 46e771d commit 7f885b2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/NuGetForUnity/Editor/Configuration/NugetConfigFile.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,8 @@ public static NugetConfigFile Load([NotNull] string filePath)
290290
var disabled = add.Attribute("value")?.Value;
291291
if (string.Equals(disabled, "true", StringComparison.OrdinalIgnoreCase))
292292
{
293-
var source = configFile.PackageSources.Find(p => p.Name == name);
293+
var source = configFile.PackageSources.Find(
294+
packageSource => packageSource.Name.Equals(name, StringComparison.OrdinalIgnoreCase));
294295
if (source != null)
295296
{
296297
source.IsEnabled = false;
@@ -670,7 +671,7 @@ private void FillPackageSourceCredentialsFromConfig(XDocument file, bool overwri
670671
foreach (var sourceElement in packageSourceCredentials.Elements())
671672
{
672673
var name = XmlConvert.DecodeName(sourceElement.Name.LocalName);
673-
var source = PackageSources.Find(p => p.Name == name);
674+
var source = PackageSources.Find(packageSource => packageSource.Name.Equals(name, StringComparison.OrdinalIgnoreCase));
674675
if (source == null || (overwriteMissingFromExternal && !string.IsNullOrEmpty(source.SavedPassword)))
675676
{
676677
continue;

0 commit comments

Comments
 (0)