@@ -14,7 +14,7 @@ abstract class PullRequestCommand extends TokenCommand {
1414 protected git : Git ;
1515
1616 protected async selectPullRequest ( ) : Promise < PullRequest | undefined > {
17- const pullRequests = await this . githubManager . listPullRequests ( ) ;
17+ const pullRequests = await this . workflowManager . listPullRequests ( ) ;
1818 const items = pullRequests . map ( pullRequest => ( {
1919 label : pullRequest . title ,
2020 description : `#${ pullRequest . number } ` ,
@@ -81,7 +81,7 @@ export class BrowseSimpleRequest extends PullRequestCommand {
8181
8282 @showProgress
8383 protected async runWithToken ( ) : Promise < void > {
84- const pullRequest = await this . githubManager . getPullRequestForCurrentBranch ( ) ;
84+ const pullRequest = await this . workflowManager . getPullRequestForCurrentBranch ( ) ;
8585 if ( pullRequest ) {
8686 await vscode . commands . executeCommand ( 'vscode.open' , vscode . Uri . parse ( pullRequest . url ) ) ;
8787 } else {
@@ -124,7 +124,7 @@ export class CreatePullRequestWithParameters extends PullRequestCommand {
124124 if ( ! this . requireRemoteTrackingBranch ( ) ) {
125125 return ;
126126 }
127- const pullRequest = await this . githubManager . createPullRequestFromData ( {
127+ const pullRequest = await this . workflowManager . createPullRequestFromData ( {
128128 sourceBranch,
129129 targetBranch,
130130 title,
@@ -151,7 +151,7 @@ export class CreateSimplePullRequest extends PullRequestCommand {
151151 if ( ! this . requireRemoteTrackingBranch ( ) ) {
152152 return ;
153153 }
154- const pullRequest = await this . githubManager . createPullRequest ( ) ;
154+ const pullRequest = await this . workflowManager . createPullRequest ( ) ;
155155 if ( pullRequest ) {
156156 this . statusBarManager . updateStatus ( ) ;
157157 this . showPullRequestNotification ( pullRequest ) ;
@@ -183,7 +183,7 @@ export class CreatePullRequest extends PullRequestCommand {
183183 if ( ! branch ) {
184184 return ;
185185 }
186- const pullRequest = await this . githubManager . createPullRequest ( {
186+ const pullRequest = await this . workflowManager . createPullRequest ( {
187187 owner,
188188 repository : repo ,
189189 branch
@@ -195,7 +195,7 @@ export class CreatePullRequest extends PullRequestCommand {
195195 }
196196
197197 private async getRepository ( ) : Promise < { label : string , repo : { defaultBranch : string } } | undefined > {
198- const repository = await this . githubManager . getRepository ( ) ;
198+ const repository = await this . workflowManager . getRepository ( ) ;
199199 const items = [ {
200200 label : repository . name ,
201201 description : '' ,
@@ -249,7 +249,7 @@ export class MergePullRequest extends PullRequestCommand {
249249 return config . preferedMergeMethod ;
250250 }
251251 const items : { label : string ; description : string ; method : MergeMethod ; } [ ] = [ ] ;
252- const enabledMethods = await this . githubManager . getEnabledMergeMethods ( ) ;
252+ const enabledMethods = await this . workflowManager . getEnabledMergeMethods ( ) ;
253253 if ( enabledMethods . has ( 'merge' ) ) {
254254 items . push ( {
255255 label : 'Create merge commit' ,
@@ -277,11 +277,11 @@ export class MergePullRequest extends PullRequestCommand {
277277
278278 @showProgress
279279 protected async runWithToken ( ) : Promise < void > {
280- const pullRequest = await this . githubManager . getPullRequestForCurrentBranch ( ) ;
280+ const pullRequest = await this . workflowManager . getPullRequestForCurrentBranch ( ) ;
281281 if ( pullRequest && pullRequest . mergeable ) {
282282 const method = await this . getMergeMethdod ( ) ;
283283 if ( method ) {
284- if ( await this . githubManager . mergePullRequest ( pullRequest , method ) ) {
284+ if ( await this . workflowManager . mergePullRequest ( pullRequest , method ) ) {
285285 this . statusBarManager . updateStatus ( ) ;
286286 vscode . window . showInformationMessage ( `Successfully merged` ) ;
287287 } else {
@@ -295,3 +295,20 @@ export class MergePullRequest extends PullRequestCommand {
295295 }
296296
297297}
298+
299+ @component ( { eager : true } )
300+ export class UpdatePullRequest extends PullRequestCommand {
301+
302+ public id = 'vscode-github.updatePullRequest' ;
303+
304+ @showProgress
305+ protected async runWithToken ( ) : Promise < void > {
306+ const pullRequest = await this . workflowManager . getPullRequestForCurrentBranch ( ) ;
307+ if ( pullRequest ) {
308+ await this . workflowManager . updatePullRequest ( pullRequest ) ;
309+ } else {
310+ vscode . window . showInformationMessage ( 'No pull request for current branch found' ) ;
311+ }
312+ }
313+
314+ }
0 commit comments