Skip to content

Commit 5003b13

Browse files
committed
Fixes compare and create-pr URLs for bitbucket-server
(#4142, #4143)
1 parent 952bc19 commit 5003b13

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/git/remotes/bitbucket-server.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,20 @@ export class BitbucketServerRemote extends RemoteProvider {
158158
}
159159

160160
protected override getUrlForComparison(base: string, head: string, _notation: '..' | '...'): string {
161-
return this.encodeUrl(`${this.baseUrl}/branches/compare/${base}%0D${head}`).replace('%250D', '%0D');
161+
const query = new URLSearchParams({ sourceBranch: `refs/heads/${head}`, targetBranch: `refs/heads/${base}` });
162+
return `${this.baseUrl}/compare?${query.toString()}`;
162163
}
163164

164165
protected override getUrlForCreatePullRequest(
165166
base: { branch?: string; remote: { path: string; url: string } },
166167
head: { branch: string; remote: { path: string; url: string } },
167168
options?: { title?: string; description?: string },
168169
): string | undefined {
169-
const query = new URLSearchParams({ sourceBranch: head.branch, targetBranch: base.branch ?? '' });
170+
const query = new URLSearchParams({
171+
sourceBranch: head.branch,
172+
targetBranch: base.branch ?? '',
173+
activeTab: 'compare-diff-tab',
174+
});
170175
// TODO: figure this out
171176
// query.set('targetRepoId', base.repoId);
172177
if (options?.title) {

0 commit comments

Comments
 (0)