File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -384,15 +384,17 @@ export class GitExtension implements IGitExtension {
384
384
'git:checkout' ,
385
385
async ( ) => {
386
386
let changes ;
387
- if ( body . checkout_branch ) {
388
- changes = await this . _changedFiles (
389
- this . _currentBranch . name ,
390
- body . branchname
391
- ) ;
392
- } else if ( body . filename ) {
393
- changes = { files : [ body . filename ] } ;
394
- } else {
395
- changes = await this . _changedFiles ( 'WORKING' , 'HEAD' ) ;
387
+ if ( ! body . new_check ) {
388
+ if ( body . checkout_branch && ! body . new_check ) {
389
+ changes = await this . _changedFiles (
390
+ this . _currentBranch . name ,
391
+ body . branchname
392
+ ) ;
393
+ } else if ( body . filename ) {
394
+ changes = { files : [ body . filename ] } ;
395
+ } else {
396
+ changes = await this . _changedFiles ( 'WORKING' , 'HEAD' ) ;
397
+ }
396
398
}
397
399
398
400
const d = await requestAPI < Git . ICheckoutResult > (
@@ -401,7 +403,7 @@ export class GitExtension implements IGitExtension {
401
403
body
402
404
) ;
403
405
404
- changes . files ?. forEach ( file => this . _revertFile ( file ) ) ;
406
+ changes ? .files ?. forEach ( file => this . _revertFile ( file ) ) ;
405
407
return d ;
406
408
}
407
409
) ;
You can’t perform that action at this time.
0 commit comments