@@ -157,19 +157,16 @@ private IEnumerable<string> GetFeedsFromNugetConfig(string nugetConfigPath) =>
157157 /// If there are no feeds, a dummy source argument is added to override any default feeds that `restore` would use.
158158 /// </summary>
159159 /// <param name="feeds">The list of feeds to use for the restore command.</param>
160- /// <param name="sourceArgumentPrefix">The prefix to use for each source argument (e.g., "-s").</param>
161160 /// <returns>The list of NuGet sources arguments for the restore command.</returns>
162- public List < string > FeedsToRestoreArgument ( IEnumerable < string > feeds , string sourceArgumentPrefix )
161+ public List < string > RestoreFeeds ( IEnumerable < string > feeds )
163162 {
164163 // If there are no feeds, we want to override any default feeds that `restore` would use by passing a dummy source argument.
165164 if ( ! feeds . Any ( ) )
166165 {
167- return [ sourceArgumentPrefix , emptyPackageDirectory . DirInfo . FullName ] ;
166+ return [ emptyPackageDirectory . DirInfo . FullName ] ;
168167 }
169168
170- // Add package sources. If any are present, they override all sources specified in
171- // the configuration file(s).
172- return feeds . SelectMany < string , string > ( feed => [ sourceArgumentPrefix , feed ] ) . ToList ( ) ;
169+ return feeds . ToList ( ) ;
173170 }
174171
175172 private IEnumerable < string > FeedsToUseAux ( HashSet < string > feedsToConsider )
@@ -202,24 +199,14 @@ public IEnumerable<string> FeedsToUse(string path)
202199 return FeedsToUseAux ( feedsToConsider ) ;
203200 }
204201
205- /// <summary>
206- /// Constructs the NuGet sources argument for the `dotnet restore` command based on the given feeds.
207- /// </summary>
208- /// <param name="feeds">The list of NuGet feeds to use for the restore command.</param>
209- /// <returns>A list representing the NuGet sources arguments for the `dotnet restore` command.</returns>
210- public List < string > FeedsToDotnetRestoreArgument ( IEnumerable < string > feeds )
211- {
212- return FeedsToRestoreArgument ( feeds , "-s" ) ;
213- }
214-
215202 /// <summary>
216203 /// Constructs the list of NuGet sources to use for dotnet restore.
217204 /// (1) Use the feeds we get from `dotnet nuget list source`
218205 /// (2) Use private registries, if they are configured
219206 /// </summary>
220207 /// <param name="path">Path to project/solution</param>
221208 /// <returns>A list representing the NuGet sources arguments for the `dotnet restore` command.</returns>
222- public List < string > MakeDotnetRestoreSourcesArguments ( string path )
209+ public List < string > MakeRestoreFeeds ( string path )
223210 {
224211 // Do not construct a set of explicit NuGet sources to use for restore.
225212 if ( ! CheckNugetFeedResponsiveness && ! HasPrivateRegistryFeeds )
@@ -229,7 +216,7 @@ public List<string> MakeDotnetRestoreSourcesArguments(string path)
229216
230217 var feedsToUse = FeedsToUse ( path ) ;
231218
232- return FeedsToDotnetRestoreArgument ( feedsToUse ) ;
219+ return RestoreFeeds ( feedsToUse ) ;
233220 }
234221
235222 private ( int initialTimeout , int tryCount ) GetFeedRequestSettings ( bool isFallback )
0 commit comments