Skip to content

Commit 350e5dd

Browse files
committed
azrepos: fix bug in binding list command
There has been a behaviour change in the System.CommandLine library. Previously string arguments that were missing would be null, but now they are the empty string. Update downlevel use of the `organization` parameter in `BindCmd` to also expect an empty/whitespace string, as well as null.
1 parent b24086c commit 350e5dd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/shared/Microsoft.AzureRepos/AzureReposBindingManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ bool ExtractUserBinding(GitConfigurationEntry entry, IDictionary<string, string>
181181
uri.Scheme == AzureDevOpsConstants.UrnScheme && uri.AbsolutePath.StartsWith(orgPrefix))
182182
{
183183
string entryOrgName = uri.AbsolutePath.Substring(orgPrefix.Length);
184-
if (orgName is null || StringComparer.OrdinalIgnoreCase.Equals(entryOrgName, orgName))
184+
if (string.IsNullOrWhiteSpace(orgName) || StringComparer.OrdinalIgnoreCase.Equals(entryOrgName, orgName))
185185
{
186186
dict[entryOrgName] = entry.Value;
187187
}

src/shared/Microsoft.AzureRepos/AzureReposHostProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ static bool IsAzureDevOpsHttpRemote(string url, out Uri uri)
596596
}
597597
}
598598

599-
bool isFiltered = organization != null;
599+
bool isFiltered = !string.IsNullOrWhiteSpace(organization);
600600
string indent = isFiltered ? string.Empty : " ";
601601

602602
// Get the set of all organization names (organization names are not case sensitive)

0 commit comments

Comments
 (0)