Skip to content

Commit 6c09df3

Browse files
committed
remove all trailing slashes for all code host platforms
1 parent 4c3aef6 commit 6c09df3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

packages/backend/src/repoCompileUtils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const compileGithubConfig = async (
6161
const gitHubRepos = gitHubReposResult.repos;
6262
const warnings = gitHubReposResult.warnings;
6363

64-
const hostUrl = config.url ?? 'https://github.com';
64+
const hostUrl = (config.url ?? 'https://github.com').replace(/\/+$/, '');
6565

6666
const repos = gitHubRepos.map((repo) => {
6767
const record = createGitHubRepoRecord({
@@ -242,7 +242,7 @@ export const compileGiteaConfig = async (
242242
const giteaRepos = giteaReposResult.repos;
243243
const warnings = giteaReposResult.warnings;
244244

245-
const hostUrl = config.url ?? 'https://gitea.com';
245+
const hostUrl = (config.url ?? 'https://gitea.com').replace(/\/+$/, '');
246246
const repoNameRoot = new URL(hostUrl)
247247
.toString()
248248
.replace(/^https?:\/\//, '');
@@ -309,7 +309,7 @@ export const compileGerritConfig = async (
309309
connectionId: number): Promise<CompileResult> => {
310310

311311
const gerritRepos = await getGerritReposFromConfig(config);
312-
const hostUrl = config.url;
312+
const hostUrl = config.url.replace(/\/+$/, '');
313313
const repoNameRoot = new URL(hostUrl)
314314
.toString()
315315
.replace(/^https?:\/\//, '');
@@ -396,7 +396,7 @@ export const compileBitbucketConfig = async (
396396
const bitbucketRepos = bitbucketReposResult.repos;
397397
const warnings = bitbucketReposResult.warnings;
398398

399-
const hostUrl = config.url ?? 'https://bitbucket.org';
399+
const hostUrl = (config.url ?? 'https://bitbucket.org').replace(/\/+$/, '');
400400
const repoNameRoot = new URL(hostUrl)
401401
.toString()
402402
.replace(/^https?:\/\//, '');

0 commit comments

Comments
 (0)