File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -212,7 +212,7 @@ export const compileGerritConfig = async (
212212 orgId : number ) => {
213213
214214 const gerritRepos = await getGerritReposFromConfig ( config ) ;
215- const hostUrl = config . url ?? 'https://gerritcodereview.com' ;
215+ const hostUrl = ( config . url ?? 'https://gerritcodereview.com' ) . replace ( / \/ $ / , '' ) ; // Remove trailing slash
216216 const hostname = new URL ( hostUrl ) . hostname ;
217217
218218 const repos = gerritRepos . map ( ( project ) => {
@@ -228,6 +228,12 @@ export const compileGerritConfig = async (
228228 }
229229 }
230230
231+ // Handle case where webUrl is just a gitiles path
232+ // https://github.com/GerritCodeReview/plugins_gitiles/blob/5ee7f57/src/main/java/com/googlesource/gerrit/plugins/gitiles/GitilesWeblinks.java#L50
233+ if ( webUrl . startsWith ( '/plugins/gitiles/' ) ) {
234+ webUrl = `${ hostUrl } ${ webUrl } ` ;
235+ }
236+
231237 const record : RepoData = {
232238 external_id : project . id . toString ( ) ,
233239 external_codeHostType : 'gerrit' ,
You can’t perform that action at this time.
0 commit comments