Skip to content

Commit d8fa611

Browse files
committed
C#: Address review comments.
1 parent e30e0a9 commit d8fa611

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private IEnumerable<string> GetFeedsFromNugetConfig(string nugetConfigPath) =>
9090

9191
public string FeedsToRestoreArgument(IEnumerable<string> feeds, string sourceArgumentPrefix)
9292
{
93-
// If there are no feeds, we want to override any default feeds that `dotnet restore` would use by passing a dummy source argument.
93+
// If there are no feeds, we want to override any default feeds that `restore` would use by passing a dummy source argument.
9494
if (!feeds.Any())
9595
{
9696
return $" {sourceArgumentPrefix} \"{emptyPackageDirectory.DirInfo.FullName}\"";
@@ -112,7 +112,7 @@ public string FeedsToRestoreArgument(IEnumerable<string> feeds, string sourceArg
112112
/// (1) Use the feeds we get from `dotnet nuget list source`
113113
/// (2) Use private registries, if they are configured
114114
/// </summary>
115-
/// <param name="path">Path to project/solution</param>
115+
/// <param name="path">Path to project/solution/packages.config</param>
116116
/// <param name="reachableFeeds">The set of reachable NuGet feeds.</param>
117117
/// <returns>The list of NuGet feeds to use for this restore.</returns>
118118
public IEnumerable<string> FeedsToUse(string path, HashSet<string> reachableFeeds)

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ private bool TryRestoreNugetPackage(string packagesConfig)
175175
var feedsToUse = feedManager.FeedsToUse(packagesConfig, reachableFeeds).ToList();
176176
var useDefaultFeed = feedsToUse.Count == 0 && IsDefaultFeedReachable;
177177

178-
// Explicitly construct the sources to be used for the restore command if any of the following is true:
178+
// Explicitly construct the sources to be used for the restore command when checking feed
179+
// responsiveness, using private registries, or falling back to nuget.org.
179180
if (feedManager.CheckNugetFeedResponsiveness || feedManager.HasPrivateRegistryFeeds || useDefaultFeed)
180181
{
181182
if (useDefaultFeed)

0 commit comments

Comments
 (0)