Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(gitcafe): SCP remotes with a leading slash find their repository #44614 (GitHub #44612)

Mergedonly21mil(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/44612/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 3 additions and 1 deletion.

x
0 of 2 viewed, 2 left
2 additions and 0 deletionspackages/source-control-gitcafe/src/server/gitCafeHosts.test.tsModified
View file
@@ -15,6 +15,7 @@
it.each([
["https://staging.git.cafe/team/project.git/", "staging.git.cafe"],
["ssh@git.cafe:team/project.git", "git.cafe"],
+ ["ssh@git.cafe:/team/project.git", "git.cafe"],
["ssh://git@git.cafe/team/project.git", "git.cafe"],
["ssh://git.cafe/team/project.git", "git.cafe"],
["ssh://git.cafe:2222/team/project.git", "git.cafe"],
@@ -29,6 +30,7 @@
it.each([
"https://evil.git.cafe/team/project.git",
"https://git.cafe/team/nested/project.git",
+ "git.cafe://team/project.git",
"team/project",
])("is not a GitCafe repository: %s", (url) => {
assert.isNull(GitCafeHosts.parseGitCafeRemote(url));
1 addition and 1 deletionpackages/source-control-gitcafe/src/server/gitCafeHosts.tsModified
View file
@@ -14,7 +14,7 @@
const REMOTE_PATTERNS = [
/^https?:\/\/(?:[^@/]+@)?([^/:]+)(?::\d+)?\/(.+)$/iu,
/^ssh:\/\/(?:[^@/]+@)?([^/:]+)(?::\d+)?\/(.+)$/iu,
- /^(?:[^@/:]+@)?([^/:]+):(.+)$/u,
+ /^(?:[^@/:]+@)?([^/:]+):\/?(.+)$/u,
];
​
export function gitCafeRepositoryPath(path: string): string | null {