Skip to content

Commit 7a7ba39

Browse files
committed
feedback
1 parent 8d8a2d3 commit 7a7ba39

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/NuGet.Core/NuGet.Commands/RestoreCommand/Logging/TransitiveNoWarnUtils.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ private static PackageSpecificWarningProperties ExtractTransitiveNoWarnPropertie
112112
{
113113
var localMatch = (LocalMatch)dependencyGraphItem.Data.Match;
114114
var nodeProjectSpec = GetNodePackageSpec(localMatch);
115-
var nearestFramework = nodeProjectSpec.GetTargetFramework(parentTargetFramework).TargetAlias;
115+
TargetFrameworkInformation targetFrameworkInformation = nodeProjectSpec.GetTargetFramework(parentTargetFramework);
116+
string nearestFramework = targetFrameworkInformation.FrameworkName != null ? targetFrameworkInformation.TargetAlias : null;
116117

117118
if (nearestFramework != null)
118119
{

test/NuGet.Core.FuncTests/NuGet.Commands.FuncTest/RestoreCommand_Aliases.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
547547
[InlineData("apple", "net9.0", "banana", "net10.0")]
548548
[InlineData("apple", "net10.0", "banana", "net10.0")]
549549
[InlineData("banana", "net10.0", "apple", "net10.0")]
550-
public async Task RestoreCommand_WithAliases_WithConditionalWarningSuppression_SupressesWarningsCorrectly(string firstAlias, string firstFramework, string secondAlias, string secondFramework)
550+
public async Task RestoreCommand_WithAliases_WithConditionalWarningSuppression_SuppressesWarningsCorrectly(string firstAlias, string firstFramework, string secondAlias, string secondFramework)
551551
{
552552
using var pathContext = new SimpleTestPathContext();
553553
var rootProject = @"
@@ -600,7 +600,7 @@ await SimpleTestPackageUtility.CreatePackagesAsync(
600600
// P (apple) -> Project2 (apple) -> Package A
601601
// P (banana) -> Project2 (banana) -> Package B
602602
[Fact]
603-
public async Task RestoreCommand_WithAliasesOfSameFrameworkAndProjectReferences_WithConditionalWarningSuppression_SupressesWarningsCorrectly()
603+
public async Task RestoreCommand_WithAliasesOfSameFrameworkAndProjectReferences_WithConditionalWarningSuppression_SuppressesWarningsCorrectly()
604604
{
605605
using var pathContext = new SimpleTestPathContext();
606606

@@ -675,7 +675,7 @@ public async Task RestoreCommand_WithAliasesOfSameFrameworkAndProjectReferences_
675675
}
676676

677677
[Fact]
678-
public async Task RestoreCommand_WithAliasesOfSameFrameworkAndProjectReferenceToASingleProject_WithConditionalWarningSuppression_SupressesWarningsCorrectly()
678+
public async Task RestoreCommand_WithAliasesOfSameFrameworkAndProjectReferenceToASingleProject_WithConditionalWarningSuppression_SuppressesWarningsCorrectly()
679679
{
680680
using var pathContext = new SimpleTestPathContext();
681681

test/TestUtilities/Test.Utility/Commands/ProjectTestHelpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public static PackageSpec WithTestRestoreMetadata(this PackageSpec spec)
155155
updated.RestoreMetadata.CentralPackageTransitivePinningEnabled = spec.RestoreMetadata?.CentralPackageTransitivePinningEnabled ?? false;
156156
if (spec.RestoreMetadata != null)
157157
{
158-
updated.RestoreMetadata.ProjectWideWarningProperties = spec.RestoreMetadata.ProjectWideWarningProperties;
158+
updated.RestoreMetadata.ProjectWideWarningProperties = spec.RestoreMetadata.ProjectWideWarningProperties.Clone();
159159
}
160160
updated.RestoreMetadata.RestoreAuditProperties = new RestoreAuditProperties()
161161
{

0 commit comments

Comments
 (0)