Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions src/Common/AzureDevOps/AzureDevOpsUrlParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static bool TryParseHostedHttp(string host, string relativeUrl, [NotNullW
}

projectPath = projectName ?? repositoryName;

if (!isVisualStudioHost)
{
if (teamName != null)
Expand Down Expand Up @@ -106,7 +106,7 @@ public static bool TryParseOnPremHttp(string relativeUrl, string virtualDirector
return false;
}

projectPath = string.Join("/", parts, 0, virtualDirectoryParts.Length) + "/" + collection + "/" + (projectName ?? repositoryName);
projectPath = string.Join("/", parts, 0, virtualDirectoryParts.Length) + "/" + collection + "/" + Uri.EscapeDataString(projectName ?? repositoryName);
return true;
}

Expand Down Expand Up @@ -176,7 +176,7 @@ public static bool TryParseOnPremSsh(Uri uri, [NotNullWhen(true)]out string? rep
repositoryPath = string.Join("/", parts, 0, teamNameIndex + 1);
return true;
}

private static bool TryParsePath(string[] parts, int startIndex, string? type, [NotNullWhen(true)]out string? repositoryPath, [NotNullWhen(true)]out string? repositoryName)
{
if (TryParsePath(parts, startIndex, type, out var projectName, out var teamName, out repositoryName))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public void TryParseOnPremHttp_Error(string relativeUrl, string virtualDir = "/"
[Theory]
[InlineData("/collection/project/team/_git/repo", "/", "/collection/project", "repo")]
[InlineData("/collection/project/_git/repo", "/", "/collection/project", "repo")]
[InlineData("/collection/project name/_git/repo", "/", "/collection/project%20name", "repo")]
[InlineData("/collection/_git/repo/", "/", "/collection/repo", "repo")]
[InlineData("/collection/_git/repo", "/", "/collection/repo", "repo")]
[InlineData("/virtual/iis/path/collection/project/team/_git/repo", "/virtual/iis/path", "virtual/iis/path/collection/project", "repo")]
Expand Down