@@ -276,20 +276,33 @@ export class GitHubRemote extends RemoteProvider<GitHubRepositoryDescriptor> {
276
276
return this . encodeUrl ( `${ this . baseUrl } /commit/${ sha } ` ) ;
277
277
}
278
278
279
- protected override getUrlForComparison ( base : string , compare : string , notation : '..' | '...' ) : string {
280
- return this . encodeUrl ( `${ this . baseUrl } /compare/${ base } ${ notation } ${ compare } ` ) ;
279
+ protected override getUrlForComparison ( base : string , head : string , notation : '..' | '...' ) : string {
280
+ return this . encodeUrl ( `${ this . baseUrl } /compare/${ base } ${ notation } ${ head } ` ) ;
281
281
}
282
282
283
283
protected override getUrlForCreatePullRequest (
284
284
base : { branch ?: string ; remote : { path : string ; url : string } } ,
285
- compare : { branch : string ; remote : { path : string ; url : string } } ,
285
+ head : { branch : string ; remote : { path : string ; url : string } } ,
286
+ options ?: { title ?: string ; description ?: string } ,
286
287
) : string | undefined {
287
- if ( base . remote . url === compare . remote . url ) {
288
- return this . encodeUrl ( `${ this . baseUrl } /pull/new/${ base . branch ?? 'HEAD' } ...${ compare . branch } ` ) ;
288
+ const query = new URLSearchParams ( ) ;
289
+ if ( options ?. title ) {
290
+ query . set ( 'title' , options . title ) ;
291
+ }
292
+ if ( options ?. description ) {
293
+ query . set ( 'body' , options . description ) ;
294
+ }
295
+
296
+ if ( base . remote . url === head . remote . url ) {
297
+ return `${ this . encodeUrl (
298
+ `${ this . baseUrl } /pull/new/${ base . branch ?? 'HEAD' } ...${ head . branch } ` ,
299
+ ) } ?${ query . toString ( ) } `;
289
300
}
290
301
291
- const [ owner ] = compare . remote . path . split ( '/' , 1 ) ;
292
- return this . encodeUrl ( `${ this . baseUrl } /pull/new/${ base . branch ?? 'HEAD' } ...${ owner } :${ compare . branch } ` ) ;
302
+ const [ owner ] = head . remote . path . split ( '/' , 1 ) ;
303
+ return `${ this . encodeUrl (
304
+ `${ this . baseUrl } /pull/new/${ base . branch ?? 'HEAD' } ...${ owner } :${ head . branch } ` ,
305
+ ) } ?${ query . toString ( ) } `;
293
306
}
294
307
295
308
protected getUrlForFile ( fileName : string , branch ?: string , sha ?: string , range ?: Range ) : string {
0 commit comments