Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AzureDevOps returns the catalog as part of the package query #59

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions NuGetResources/NuGetPackageFeed3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,16 @@ internal IEnumerable<PackageBase> Find(string registrationUrl, NuGetSearchContex
// Package is from packageId + version
// PackageRegistration is from packageId
bool isRegistrationType = false;
bool isCatalogRoot = false;
foreach (string t in root.Metadata.type)
{
if (t.Equals("PackageRegistration", StringComparison.OrdinalIgnoreCase))
{
isRegistrationType = true;
break;
}
else if (t.Equals("catalog:CatalogRoot", StringComparison.OrdinalIgnoreCase))
{
isCatalogRoot = true;
}
}

Expand All @@ -100,7 +104,7 @@ internal IEnumerable<PackageBase> Find(string registrationUrl, NuGetSearchContex
// In addition, when DeepMetadataBypass is enabled, we MUST use the registration index to get package info
// If a call to -Name -RequiredVersion is done, DeepMetadataBypass will never be enabled (for now)
// If we wanted, we could enable this by checking if !isRegistrationType && context.EnableDeepMetadataBypass, then call into Find with the registration index URL
if (!context.AllVersions && packageSemanticVersions != null && !context.EnableDeepMetadataBypass)
if (!context.AllVersions && packageSemanticVersions != null && !context.EnableDeepMetadataBypass && !isCatalogRoot)
{
foreach (SemanticVersion packageVersion in context.PackageInfo.AllVersions)
{
Expand Down