File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -307,11 +307,8 @@ export function rawWorkspaceToWorkspaceData(rawWorkspaces: Workspace): Workspace
307307export function rawWorkspaceToWorkspaceData ( rawWorkspaces : Workspace [ ] ) : WorkspaceData [ ] ;
308308export function rawWorkspaceToWorkspaceData ( rawWorkspaces : Workspace | Workspace [ ] ) {
309309 const toWorkspaceData = ( ws : Workspace ) => {
310- if ( ws . context ?. details . case !== 'git' ) {
311- // impossible since we filter them first
312- throw new Error ( `Workspace ${ ws . workspaceId } is not a git workspace` ) ;
313- }
314- const url = new URL ( ws . context . details . value . normalizedContextUrl ) ;
310+ const contextUrl = ws . context ?. details . case === 'git' ? ws . context . details . value . normalizedContextUrl : ws . context . contextUrl ;
311+ const url = new URL ( contextUrl ) ;
315312 const provider = url . host . replace ( / \. .+ ?$ / , '' ) ; // remove '.com', etc
316313 const matches = url . pathname . match ( / [ ^ / ] + / g) ! ; // match /owner/repo
317314 const owner = matches [ 0 ] ;
@@ -321,7 +318,7 @@ export function rawWorkspaceToWorkspaceData(rawWorkspaces: Workspace | Workspace
321318 owner,
322319 repo,
323320 id : ws . workspaceId ,
324- contextUrl : ws . context . details . value . normalizedContextUrl ,
321+ contextUrl,
325322 workspaceUrl : ws . status ! . instance ! . status ! . url ,
326323 phase : WorkspaceInstanceStatus_Phase [ ws . status ! . instance ! . status ! . phase ?? WorkspaceInstanceStatus_Phase . UNSPECIFIED ] . toLowerCase ( ) as WorkspacePhase ,
327324 description : ws . description ,
You can’t perform that action at this time.
0 commit comments