Skip to content

Commit 911b8b5

Browse files
committed
Fixes create-repo URL for bitbucket cloud
(#4142, #4143)
1 parent a0538f3 commit 911b8b5

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/git/remotes/bitbucket.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export class BitbucketRemote extends RemoteProvider<RepositoryDescriptor> {
154154
): string | undefined {
155155
const { owner, name } = this.repoDesc;
156156
const query = new URLSearchParams({ source: head.branch, dest: `${owner}/${name}::${base.branch ?? ''}` });
157-
return `${this.encodeUrl(`${this.baseUrl}/pull-requests/new`)}?${query.toString()}`;
157+
return `${this.encodeUrl(`${this.getRepoBaseUrl(head.remote.path)}/pull-requests/new`)}?${query.toString()}`;
158158
}
159159

160160
protected getUrlForFile(fileName: string, branch?: string, sha?: string, range?: Range): string {

src/git/remotes/remoteProvider.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,11 @@ export abstract class RemoteProvider<T extends ResourceDescriptor = ResourceDesc
159159
}
160160

161161
protected get baseUrl(): string {
162-
return `${this.protocol}://${this.domain}/${this.path}`;
162+
return this.getRepoBaseUrl(this.path);
163+
}
164+
165+
protected getRepoBaseUrl(path: string): string {
166+
return `${this.protocol}://${this.domain}/${path}`;
163167
}
164168

165169
protected formatName(name: string): string {

0 commit comments

Comments
 (0)