File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -343,7 +343,7 @@ export const getCodeHostCommitUrl = ({
343343export const getCodeHostBrowseAtBranchUrl = ( {
344344 webUrl,
345345 codeHostType,
346- branchName,
346+ branchName : _branchName ,
347347} : {
348348 webUrl ?: string | null ,
349349 codeHostType : CodeHostType ,
@@ -353,6 +353,8 @@ export const getCodeHostBrowseAtBranchUrl = ({
353353 return undefined ;
354354 }
355355
356+ const branchName = _branchName . replace ( / ^ r e f s \/ ( h e a d s | t a g s ) \/ / , '' ) ;
357+
356358 switch ( codeHostType ) {
357359 case 'github' :
358360 return `${ webUrl } /tree/${ branchName } ` ;
@@ -376,7 +378,7 @@ export const getCodeHostBrowseAtBranchUrl = ({
376378export const getCodeHostBrowseFileAtBranchUrl = ( {
377379 webUrl,
378380 codeHostType,
379- branchName,
381+ branchName : _branchName ,
380382 filePath,
381383} : {
382384 webUrl ?: string | null ,
@@ -388,6 +390,8 @@ export const getCodeHostBrowseFileAtBranchUrl = ({
388390 return undefined ;
389391 }
390392
393+ const branchName = _branchName . replace ( / ^ r e f s \/ ( h e a d s | t a g s ) \/ / , '' ) ;
394+
391395 switch ( codeHostType ) {
392396 case 'github' :
393397 return `${ webUrl } /blob/${ branchName } /${ filePath } ` ;
You can’t perform that action at this time.
0 commit comments