You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support actual new Azure DevOps Git link format with forward slashes
The new format uses forward slashes instead of %2f encoding:
- Legacy: vstfs:///Git/Commit/{projectId}%2f{repoId}%2f{commitId}
- New: vstfs:///Git/Commit/{projectName}/{repoName}/{commitId}
Key differences:
- New format uses / separator instead of %2f
- New format uses project/repo names instead of GUIDs
- Repo lookup is by name for new format, by ID for legacy
Updated tests to cover both formats correctly
Co-authored-by: MrHinsh <5205575+MrHinsh@users.noreply.github.com>
Log.Warning("GitRepositoryInfo: Invalid Git external link format. Expected at least 2 parts separated by %2f, but got {count} parts. Link: {link}",bits.Length,gitExternalLink.LinkedArtifactUri);
104
-
returnnull;
105
-
}
106
-
107
-
// Support both old format (3+ parts) and new format (2 parts)
// Validate that we have at least 3 parts (projectId, repoId, commitId) for legacy format
105
+
if(bits.Length<3)
106
+
{
107
+
Log.Warning("GitRepositoryInfo: Invalid Git external link format (legacy). Expected at least 3 parts separated by %2f, but got {count} parts. Link: {link}",bits.Length,gitExternalLink.LinkedArtifactUri);
Log.Warning("GitRepositoryInfo: Invalid Git external link format (new). Link does not start with expected prefix. Link: {link}",gitExternalLink.LinkedArtifactUri);
// Validate that we have at least 3 parts (projectName, repoName, commitId)
137
+
if(parts.Length<3)
138
+
{
139
+
Log.Warning("GitRepositoryInfo: Invalid Git external link format (new). Expected at least 3 parts separated by /, but got {count} parts. Link: {link}",parts.Length,gitExternalLink.LinkedArtifactUri);
140
+
returnnull;
141
+
}
142
+
143
+
// New format: projectName/repoName/commitId
144
+
stringrepoName=parts[1];
145
+
commitID=parts[2];
146
+
147
+
// Handle commit IDs that may contain additional slashes
0 commit comments