fix relative path edge case

Signed-off-by: ahmed <ahmed@planet.com>
This commit is contained in:
ahmed
2022-07-14 17:03:15 +02:00
parent 45054f5433
commit 1379080c92
@@ -125,8 +125,12 @@ export class GitlabUrlReader implements UrlReader {
);
// Considering self hosted gitlab with relative
// assuming '/gitlab' is the relative path
// from: /gitlab/repo/project
// to: repo/project
if (relativePath) {
repoFullName = trimStart(full_name, relativePath);
const rectifiedRelativePath = `${trimStart(relativePath, '/')}/`;
repoFullName = full_name.replace(rectifiedRelativePath, '');
}
// Use GitLab API to get the default branch