File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -383,21 +383,25 @@ export class GitExtension implements IGitExtension {
383383 const data = await this . _taskHandler . execute < Git . ICheckoutResult > (
384384 'git:checkout' ,
385385 async ( ) => {
386- const d = await requestAPI < Git . ICheckoutResult > (
387- 'checkout' ,
388- 'POST' ,
389- body
390- ) ;
391-
386+ let changes ;
392387 if ( body . checkout_branch ) {
393- const changes = await this . _changedFiles (
388+ changes = await this . _changedFiles (
394389 this . _currentBranch . name ,
395390 body . branchname
396391 ) ;
397- changes . files ?. forEach ( file => this . _revertFile ( file ) ) ;
392+ } else if ( body . filename ) {
393+ changes = { files : [ body . filename ] } ;
398394 } else {
399- this . _revertFile ( options . filename ) ;
395+ changes = await this . _changedFiles ( 'WORKING' , 'HEAD' ) ;
400396 }
397+
398+ const d = await requestAPI < Git . ICheckoutResult > (
399+ 'checkout' ,
400+ 'POST' ,
401+ body
402+ ) ;
403+
404+ changes . files ?. forEach ( file => this . _revertFile ( file ) ) ;
401405 return d ;
402406 }
403407 ) ;
You can’t perform that action at this time.
0 commit comments