Skip to content

Commit 353086f

Browse files
Updates getPullRequestBranchDeepLink to require PR input
1 parent 5c072ea commit 353086f

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

src/plus/launchpad/launchpadProvider.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -516,10 +516,10 @@ export class LaunchpadProvider implements Disposable {
516516

517517
return getPullRequestBranchDeepLink(
518518
this.container,
519+
item.underlyingPullRequest,
519520
branchName,
520521
item.repoIdentity.remote.url,
521522
action,
522-
item.underlyingPullRequest,
523523
);
524524
}
525525

@@ -1061,10 +1061,10 @@ function ensureRemoteUrl(url: string) {
10611061

10621062
export function getPullRequestBranchDeepLink(
10631063
container: Container,
1064+
pr: PullRequest,
10641065
headRefBranchName: string,
10651066
remoteUrl: string,
10661067
action?: DeepLinkActionType,
1067-
pr?: PullRequest,
10681068
): Uri {
10691069
const schemeOverride = configuration.get('deepLinks.schemeOverride');
10701070
const scheme = typeof schemeOverride === 'string' ? schemeOverride : env.uriScheme;
@@ -1075,11 +1075,10 @@ export function getPullRequestBranchDeepLink(
10751075
if (action) {
10761076
searchParams.set('action', action);
10771077
}
1078-
if (pr) {
1079-
searchParams.set('prId', pr.id);
1080-
searchParams.set('prTitle', pr.title);
1081-
}
1082-
if (pr?.refs) {
1078+
1079+
searchParams.set('prId', pr.id);
1080+
searchParams.set('prTitle', pr.title);
1081+
if (pr.refs) {
10831082
searchParams.set('prBaseRef', pr.refs.base.sha);
10841083
searchParams.set('prHeadRef', pr.refs.head.sha);
10851084
}

src/views/viewCommands.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -913,10 +913,10 @@ export class ViewCommands implements Disposable {
913913
if (remoteUrl != null) {
914914
const deepLink = getPullRequestBranchDeepLink(
915915
this.container,
916+
pr,
916917
node.branch.getNameWithoutRemote(),
917918
remoteUrl,
918919
DeepLinkActionType.SwitchToPullRequestWorktree,
919-
pr,
920920
);
921921

922922
return this.container.deepLinks.processDeepLinkUri(deepLink, false, node.repo);
@@ -942,10 +942,10 @@ export class ViewCommands implements Disposable {
942942

943943
const deepLink = getPullRequestBranchDeepLink(
944944
this.container,
945+
pr,
945946
pr.refs.head.branch,
946947
repoIdentity.remote.url,
947948
DeepLinkActionType.SwitchToPullRequestWorktree,
948-
pr,
949949
);
950950

951951
const prRepo = await getOrOpenPullRequestRepository(this.container, pr, {

src/webviews/plus/graph/graphWebview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3886,10 +3886,10 @@ export class GraphWebviewProvider implements WebviewProvider<State, State, Graph
38863886
if (remoteUrl != null) {
38873887
const deepLink = getPullRequestBranchDeepLink(
38883888
this.container,
3889+
pr,
38893890
branch.getNameWithoutRemote(),
38903891
remoteUrl,
38913892
DeepLinkActionType.SwitchToPullRequestWorktree,
3892-
pr,
38933893
);
38943894

38953895
return this.container.deepLinks.processDeepLinkUri(deepLink, false, repo);

0 commit comments

Comments
 (0)