File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -307,7 +307,9 @@ export function rawWorkspaceToWorkspaceData(rawWorkspaces: Workspace): Workspace
307307export function rawWorkspaceToWorkspaceData ( rawWorkspaces : Workspace [ ] ) : WorkspaceData [ ] ;
308308export function rawWorkspaceToWorkspaceData ( rawWorkspaces : Workspace | Workspace [ ] ) {
309309 const toWorkspaceData = ( ws : Workspace ) => {
310- const contextUrl = ws . context ?. details . case === 'git' ? ws . context . details . value . normalizedContextUrl : ws . context . contextUrl ;
310+ // https://github.com/gitpod-io/gitpod/blob/7e0c605a3d470b8cee0e841e51da9b20022f4f4b/components/public-api-server/pkg/apiv1/workspace.go#L332-L335
311+ // it's always git context, safe to go
312+ const contextUrl = ws . context ?. details . case === 'git' ? ws . context . details . value . normalizedContextUrl : ws . context ! . contextUrl ;
311313 const url = new URL ( contextUrl ) ;
312314 const provider = url . host . replace ( / \. .+ ?$ / , '' ) ; // remove '.com', etc
313315 const matches = url . pathname . match ( / [ ^ / ] + / g) ! ; // match /owner/repo
You can’t perform that action at this time.
0 commit comments