mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 18:51:59 +00:00
Update client/web-sveltekit/src/routes/[...repo=reporev]/-/commit/[...revspec]/+page.ts
Co-authored-by: Camden Cheek <camden@ccheek.com>
This commit is contained in:
parent
10e69021d0
commit
2f2e464296
@ -19,13 +19,11 @@ export const load: PageLoad = async ({ url, params }) => {
|
||||
}
|
||||
|
||||
const commit = result.data?.repository?.commit
|
||||
const isPerforceDepot = commit?.perforceChangelist !== null
|
||||
|
||||
if (!commit) {
|
||||
error(404, 'Commit not found')
|
||||
}
|
||||
|
||||
if (isPerforceDepot) {
|
||||
if (commit.perforceChangelist !== null) {
|
||||
const redirectURL = new URL(url)
|
||||
redirectURL.pathname = `${params.repo}/-/changelist/${commit.perforceChangelist?.cid}`
|
||||
redirect(301, redirectURL)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user