mirror of
https://github.com/github/codeql.git
synced 2026-04-25 08:45:14 +02:00
C#: Deduplicate not yet restored package names
This commit is contained in:
@@ -924,6 +924,17 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
|
||||
return;
|
||||
}
|
||||
|
||||
var multipleVersions = notYetDownloadedPackages
|
||||
.GroupBy(p => p.Name)
|
||||
.Where(g => g.Count() > 1)
|
||||
.Select(g => g.Key);
|
||||
|
||||
foreach (var package in multipleVersions)
|
||||
{
|
||||
logger.LogWarning($"Found multiple not yet restored packages with name '{package}'.");
|
||||
notYetDownloadedPackages.Remove(new(package, PackageReferenceSource.PackagesConfig));
|
||||
}
|
||||
|
||||
logger.LogInfo($"Found {notYetDownloadedPackages.Count} packages that are not yet restored");
|
||||
|
||||
var nugetConfigs = allFiles.SelectFileNamesByName("nuget.config").ToArray();
|
||||
|
||||
Reference in New Issue
Block a user