Skip to content

Commit 38c452f

Browse files
hellocn9Copilot
andauthored
Update cmd/oras/root/cp.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: hellocn9 <zhangyancn9@126.com>
1 parent 762bcc2 commit 38c452f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cmd/oras/root/cp.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,12 +354,12 @@ func platformMatches(a, b *ocispec.Platform) bool {
354354
return false
355355
}
356356

357-
// Variant is optional, if one is empty, ignore comparison
357+
// Variant is optional; only treat it as a mismatch if both variants are non-empty and different.
358358
if a.Variant != "" && b.Variant != "" && a.Variant != b.Variant {
359359
return false
360360
}
361361

362-
// OSVersion is optional, if one is empty, ignore comparison
362+
// OSVersion is optional; only treat it as a mismatch if both OSVersions are non-empty and different.
363363
if a.OSVersion != "" && b.OSVersion != "" && a.OSVersion != b.OSVersion {
364364
return false
365365
}

0 commit comments

Comments
 (0)