Skip to content

Commit 27ff77e

Browse files
committed
Use explicitFeeds directly
1 parent acba599 commit 27ff77e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,11 @@ public HashSet<AssemblyLookupLocation> Restore()
127127
(explicitFeeds, allFeeds) = GetAllFeeds();
128128
var inheritedFeeds = allFeeds.Except(explicitFeeds).ToHashSet();
129129

130-
// Check whether the explicit feeds can be reached.
131-
HashSet<string> feedsToCheck = explicitFeeds;
132-
133-
// If private package registries are configured for C#, then check those
130+
// If private package registries are configured for C#, then consider those
134131
// in addition to the ones that are configured in `nuget.config` files.
135-
this.dependabotProxy?.RegistryURLs.ForEach(url => feedsToCheck.Add(url));
132+
this.dependabotProxy?.RegistryURLs.ForEach(url => explicitFeeds.Add(url));
136133

137-
var explicitFeedsReachable = this.CheckSpecifiedFeeds(feedsToCheck);
134+
var explicitFeedsReachable = this.CheckSpecifiedFeeds(explicitFeeds);
138135

139136
if (inheritedFeeds.Count > 0)
140137
{
@@ -191,6 +188,7 @@ public HashSet<AssemblyLookupLocation> Restore()
191188
logger.LogError($"Failed to restore NuGet packages with nuget.exe: {exc.Message}");
192189
}
193190

191+
// Restore project dependencies with `dotnet restore`.
194192
var restoredProjects = RestoreSolutions(out var container);
195193
var projects = fileProvider.Projects.Except(restoredProjects);
196194
RestoreProjects(projects, allFeeds, out var containers);

0 commit comments

Comments
 (0)