GeezerVison is showing github.com — fix(gitcafe): SCP remotes with a leading slash find their repository … · pingdotgg/t3code@7ea8041
File treeExpand file treeCollapse file tree Open diff view settings packages/source-control-gitcafe/src/server
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/source-control-gitcafe/src/server/gitCafeHosts.test.ts +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -15,6 +15,7 @@ describe("gitCafeHosts", () => { | 15 | 15 | it.each([ | 16 | 16 | ["https://staging.git.cafe/team/project.git/", "staging.git.cafe"], | 17 | 17 | | | 18 | + | 18 | 19 | | 19 | 20 | ["ssh://git.cafe/team/project.git", "git.cafe"], | 20 | 21 | ["ssh://git.cafe:2222/team/project.git", "git.cafe"], | @@ -29,6 +30,7 @@ describe("gitCafeHosts", () => { | 29 | 30 | it.each([ | 30 | 31 | "https://evil.git.cafe/team/project.git", | 31 | 32 | "https://git.cafe/team/nested/project.git", | | 33 | + "git.cafe://team/project.git", | 32 | 34 | "team/project", | 33 | 35 | ])("is not a GitCafe repository: %s", (url) => { | 34 | 36 | assert.isNull(GitCafeHosts.parseGitCafeRemote(url)); | |
Collapse file Copy file name to clipboardExpand all lines: packages/source-control-gitcafe/src/server/gitCafeHosts.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -14,7 +14,7 @@ const REPOSITORY = /^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/u; | 14 | 14 | const REMOTE_PATTERNS = [ | 15 | 15 | /^https?:\/\/(?:[^@/]+@)?([^/:]+)(?::\d+)?\/(.+)$/iu, | 16 | 16 | /^ssh:\/\/(?:[^@/]+@)?([^/:]+)(?::\d+)?\/(.+)$/iu, | 17 | | - /^(?:[^@/:]+@)?([^/:]+):(.+)$/u, | | 17 | + /^(?:[^@/:]+@)?([^/:]+):\/?(.+)$/u, | 18 | 18 | ]; | 19 | 19 |
| 20 | 20 | export function gitCafeRepositoryPath(path: string): string | null { | |
|