Skip to content

Commit

Permalink
Parse GitLab merge request URLs to identify those in Launchpad
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeibbb committed Dec 26, 2024
1 parent 8beeb54 commit a7e5316
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/git/models/pullRequest.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ export function getPullRequestIdentityValuesFromSearch(search: string): PullRequ
let ownerAndRepo: string | undefined = undefined;
let prNumber: string | undefined = undefined;

let match = search.match(/([^/]+\/[^/]+)\/pull\/(\d+)/); // with org and rep name
let match = search.match(/([^/]+\/[^/]+)\/(?:pull|-\/merge_requests)\/(\d+)/); // with org and rep name
if (match != null) {
ownerAndRepo = match[1];
prNumber = match[2];
}

if (prNumber == null) {
match = search.match(/(?:\/|^)pull\/(\d+)/); // without repo name
match = search.match(/(?:\/|^)(?:pull|-\/merge_requests)\/(\d+)/); // without repo name
if (match != null) {
prNumber = match[1];
}
Expand Down

0 comments on commit a7e5316

Please sign in to comment.