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 {
383
383
const data = await this . _taskHandler . execute < Git . ICheckoutResult > (
384
384
'git:checkout' ,
385
385
async ( ) => {
386
- const d = await requestAPI < Git . ICheckoutResult > (
387
- 'checkout' ,
388
- 'POST' ,
389
- body
390
- ) ;
391
-
386
+ let changes ;
392
387
if ( body . checkout_branch ) {
393
- const changes = await this . _changedFiles (
388
+ changes = await this . _changedFiles (
394
389
this . _currentBranch . name ,
395
390
body . branchname
396
391
) ;
397
- changes . files ?. forEach ( file => this . _revertFile ( file ) ) ;
392
+ } else if ( body . filename ) {
393
+ changes = { files : [ body . filename ] } ;
398
394
} else {
399
- this . _revertFile ( options . filename ) ;
395
+ changes = await this . _changedFiles ( 'WORKING' , 'HEAD' ) ;
400
396
}
397
+
398
+ const d = await requestAPI < Git . ICheckoutResult > (
399
+ 'checkout' ,
400
+ 'POST' ,
401
+ body
402
+ ) ;
403
+
404
+ changes . files ?. forEach ( file => this . _revertFile ( file ) ) ;
401
405
return d ;
402
406
}
403
407
) ;
You can’t perform that action at this time.
0 commit comments