File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -262,9 +262,21 @@ private IEnumerable<string> RestoreSolutions(out DependencyContainer dependencie
262262 /// <param name="projects">A list of paths to project files.</param>
263263 private void RestoreProjects ( IEnumerable < string > projects , HashSet < string > ? configuredSources , out ConcurrentBag < DependencyContainer > dependencies )
264264 {
265- var sources = configuredSources ?? new ( ) ;
266- sources . Add ( PublicNugetOrgFeed ) ;
267- this . dependabotProxy ? . RegistryURLs . ForEach ( url => sources . Add ( url ) ) ;
265+ // Conservatively, we only set this to a non-null value if a Dependabot proxy is enabled.
266+ // This ensures that we continue to get the old behaviour where feeds are taken from
267+ // `nuget.config` files instead of the command-line arguments.
268+ HashSet < string > ? sources = null ;
269+
270+ if ( this . dependabotProxy != null )
271+ {
272+ // If the Dependabot proxy is configured, then our main goal is to make `dotnet` aware
273+ // of the private registry feeds. However, since providing them as command-line arguments
274+ // to `dotnet` ignores other feeds that may be configured, we also need to add the feeds
275+ // we have discovered from analysing `nuget.config` files.
276+ sources = configuredSources ?? new ( ) ;
277+ sources . Add ( PublicNugetOrgFeed ) ;
278+ this . dependabotProxy ? . RegistryURLs . ForEach ( url => sources . Add ( url ) ) ;
279+ }
268280
269281 var successCount = 0 ;
270282 var nugetSourceFailures = 0 ;
You can’t perform that action at this time.
0 commit comments