Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): self-hosted GitLab projects resolve bare pull request numbers #15395

MergedTonybynMp4(GitHub profile, opens in a new tab)merged 7 commits intomain fromrefs/pull/15395/headmerged by juliusmarminge View on GitHub

Showing 4 changed files with 92 additions and 3 deletions (loading 1).

x
0 of 4 viewed, 4 left
8 additions and 0 deletionspackages/shared/src/git.test.tsModified
View file
@@ -54,6 +54,14 @@
expect(normalizeGitRemoteUrl("deploy@bitbucket.org:workspace/repo.git")).toBe(
"bitbucket.org/workspace/repo",
);
+ expect(normalizeGitRemoteUrl("code.example.test:team/repo.git")).toBe(
+ "code.example.test/team/repo",
+ );
+ expect(normalizeGitRemoteUrl("git@code.example.test:/team/repo.git")).toBe(
+ "code.example.test/team/repo",
+ );
+ expect(normalizeGitRemoteUrl("C:/repos/project")).toBe("c:/repos/project");
+ expect(normalizeGitRemoteUrl("git@x:team/project.git")).toBe("x/team/project");
});
​
it("gives an Azure DevOps repository the same key over SSH as over HTTPS", () => {
4 additions and 3 deletionspackages/shared/src/git.tsModified
View file
@@ -163,9 +163,10 @@
​
- const scpStyleHostAndPath = /^[a-zA-Z0-9._-]+@([^:/\s]+):([^/\s]+(?:\/[^/\s]+)+)$/i.exec(
- normalized,
- );
+ // A userless one-letter prefix is a Windows drive, not an SCP host.
+ const scpStyleHostAndPath = /^[a-z]:/i.test(normalized)
+ ? null
+ : /^(?:[a-zA-Z0-9._-]+@)?([^@:/\\\s]+):\/?([^/\s]+(?:\/[^/\s]+)+)$/i.exec(normalized);