Repository navigation
fix(client-runtime): pasted repository page URLs clone the repository into its own folder #32681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
990cccf
8a12aba
a046c64
fa97477
adfedf5
aa06b67
bb7780f
210dd4c
930287e
82e4732
e3c800d
aa5b807
09e12cd
9ba4688
00c1188
8a23cc7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ import { | |
| isChangeRequestOnProjectHost, | ||
| parseChangeRequestPath, | ||
| parseCommitPath, | ||
| repositoryUrlFromPagePath, | ||
| projectChangeRequestHost, | ||
| remoteWebOrigin, | ||
| type SourceControlAppSignIn, | ||
|
|
@@ -26,6 +27,7 @@ const CHANGE_REQUEST_REFERENCE = | |
| const CHANGE_REQUEST_PATH = /^\/([^/]+\/[^/]+)\/pull\/(\d+)(?:\/|$)/u; | ||
| const COMMIT_PATH = /^\/([^/]+\/[^/]+)\/(?:commit|pull\/\d+\/commits)\/([0-9a-f]+)\/?$/iu; | ||
| const ISSUE_PATH = /^\/([^/]+\/[^/]+)\/issues\/(\d+)(?:\/|$)/u; | ||
| const REPOSITORY_PAGE_PATH = /^\/([^/]+\/[^/]+)\/(?:tree|blob)\/[^/]/u; | ||
|
|
||
| const KIND = SourceControlProviderKind.make("github"); | ||
|
|
||
|
|
@@ -98,6 +100,8 @@ export const definition = defineSourceControl({ | |
| parseCommitUrl: (url, known) => | ||
| known || isGitHubHost(url.hostname) ? parseCommitPath(url, COMMIT_PATH) : null, | ||
| parseChangeRequestUrl: (url) => parseChangeRequestPath(url, CHANGE_REQUEST_PATH), | ||
| repositoryUrlFromPage: (url) => | ||
| isGitHubHost(url.hostname) ? repositoryUrlFromPagePath(url, REPOSITORY_PAGE_PATH) : null, | ||
|
Comment on lines
+103
to
+104
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| // GitHub writes every bare reference through `/issues/`, including pull requests. | ||
| changeRequestUrlFromReferenceAutolink: (url) => { | ||
| const match = isGitHubHost(url.hostname) ? ISSUE_PATH.exec(url.pathname) : null; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script executed:
Repository: pingdotgg/t3code
Length of output: 41573
Script executed:
Repository: pingdotgg/t3code
Length of output: 28169
Script executed:
Repository: pingdotgg/t3code
Length of output: 22376
Add a test for the palette destination.
The shared test does not exercise the palette’s destination calculation. With ghq layout off, passing
rawRepositoryagain would suggestmaininstead oft3codeand leave that test passing. Add a palette test that pastes a page URL and checks the suggested destination.Source: Coding guidelines