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 Nov 25, 2024
1 parent 2eee0c1 commit df084c7
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 @@ -11,14 +11,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 df084c7

Please sign in to comment.