@@ -29,7 +29,7 @@ export const compileGithubConfig = async (
2929 const notFound = gitHubReposResult . notFound ;
3030
3131 const hostUrl = config . url ?? 'https://github.com' ;
32- const hostname = config . url ? new URL ( config . url ) . hostname : 'github.com' ;
32+ const hostname = new URL ( hostUrl ) . hostname ;
3333
3434 const repos = gitHubRepos . map ( ( repo ) => {
3535 const repoName = `${ hostname } /${ repo . full_name } ` ;
@@ -92,18 +92,20 @@ export const compileGitlabConfig = async (
9292 const notFound = gitlabReposResult . notFound ;
9393
9494 const hostUrl = config . url ?? 'https://gitlab.com' ;
95+ const hostname = new URL ( hostUrl ) . hostname ;
9596
9697 const repos = gitlabRepos . map ( ( project ) => {
9798 const projectUrl = `${ hostUrl } /${ project . path_with_namespace } ` ;
9899 const cloneUrl = new URL ( project . http_url_to_repo ) ;
99100 const isFork = project . forked_from_project !== undefined ;
101+ const repoName = `${ hostname } /${ project . path_with_namespace } ` ;
100102
101103 const record : RepoData = {
102104 external_id : project . id . toString ( ) ,
103105 external_codeHostType : 'gitlab' ,
104106 external_codeHostUrl : hostUrl ,
105107 cloneUrl : cloneUrl . toString ( ) ,
106- name : project . path_with_namespace ,
108+ name : repoName ,
107109 imageUrl : project . avatar_url ,
108110 isFork : isFork ,
109111 isArchived : ! ! project . archived ,
@@ -121,7 +123,7 @@ export const compileGitlabConfig = async (
121123 gitConfig : {
122124 'zoekt.web-url-type' : 'gitlab' ,
123125 'zoekt.web-url' : projectUrl ,
124- 'zoekt.name' : project . path_with_namespace ,
126+ 'zoekt.name' : repoName ,
125127 'zoekt.gitlab-stars' : ( project . stargazers_count ?? 0 ) . toString ( ) ,
126128 'zoekt.gitlab-forks' : ( project . forks_count ?? 0 ) . toString ( ) ,
127129 'zoekt.archived' : marshalBool ( project . archived ) ,
@@ -153,16 +155,18 @@ export const compileGiteaConfig = async (
153155 const notFound = giteaReposResult . notFound ;
154156
155157 const hostUrl = config . url ?? 'https://gitea.com' ;
158+ const hostname = new URL ( hostUrl ) . hostname ;
156159
157160 const repos = giteaRepos . map ( ( repo ) => {
158161 const cloneUrl = new URL ( repo . clone_url ! ) ;
162+ const repoName = `${ hostname } /${ repo . full_name ! } ` ;
159163
160164 const record : RepoData = {
161165 external_id : repo . id ! . toString ( ) ,
162166 external_codeHostType : 'gitea' ,
163167 external_codeHostUrl : hostUrl ,
164168 cloneUrl : cloneUrl . toString ( ) ,
165- name : repo . full_name ! ,
169+ name : repoName ,
166170 imageUrl : repo . owner ?. avatar_url ,
167171 isFork : repo . fork ! ,
168172 isArchived : ! ! repo . archived ,
@@ -180,7 +184,7 @@ export const compileGiteaConfig = async (
180184 gitConfig : {
181185 'zoekt.web-url-type' : 'gitea' ,
182186 'zoekt.web-url' : repo . html_url ! ,
183- 'zoekt.name' : repo . full_name ! ,
187+ 'zoekt.name' : repoName ,
184188 'zoekt.archived' : marshalBool ( repo . archived ) ,
185189 'zoekt.fork' : marshalBool ( repo . fork ! ) ,
186190 'zoekt.public' : marshalBool ( repo . internal === false && repo . private === false ) ,
0 commit comments