dotnet / dotnet/sourcelink

TranslateSshUrl requires _ssh segment in git url

Open
#708 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
C#
Stars
1.4k
Forks
148
PR merge metrics
No merged PRs in 30d

Description

In Microsoft.SourceLink.AzureDevOpsServer.Git.TranslateRepositoryUrls it is required to have **_ssh** segment in a git repo url.

AzureDevOpsUrlParser.cs
```
public static bool TryParseOnPremSsh(Uri uri, [NotNullWhen(true)]out string? repositoryPath, [NotNullWhen(true)]out string? repositoryName)
{
repositoryPath = repositoryName = null;

if (!UriUtilities.TrySplitRelativeUrl(uri.GetPath(), out var parts))
{
return false;
}

if (!TryParseRepositoryName(parts, out int teamNameIndex, "_ssh", out repositoryName))
{
return false;
}

repositoryPath = string.Join("/", parts, 0, teamNameIndex + 1);
return true;
}
```

`ssh://account@mytfs.com:22/tfs/project/team/_git/repo` is considered invalid.

We have an old TFS server:
Microsoft Visual Studio Team Foundation Server
Version 15

Could you shed a light on why only urls with _ssh are considered valid?
Maybe it's possible to remove the check in TryParseRepositoryName method?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.