@@ -1424,7 +1424,6 @@ export class GitService extends Disposable {
14241424 if ( options . ref === GitService . deletedSha ) return false ;
14251425
14261426 let ref = options . ref ;
1427-
14281427 let cacheKey : string ;
14291428 let fileName : string ;
14301429 if ( typeof fileNameOrUri === 'string' ) {
@@ -1444,19 +1443,32 @@ export class GitService extends Disposable {
14441443 cacheKey += `:${ ref } ` ;
14451444 }
14461445
1447- Logger . log ( `isTracked('${ fileName } ', '${ repoPath } ', '${ ref } ')` ) ;
1446+ Logger . log ( `isTracked('${ fileName } ', '${ repoPath } '${ ref !== undefined ? ` , '${ ref } '` : '' } )` ) ;
14481447
14491448 let tracked = this . _trackedCache . get ( cacheKey ) ;
1450- if ( tracked !== undefined ) return await tracked ;
1449+ try {
1450+ if ( tracked !== undefined ) {
1451+ tracked = await tracked ;
14511452
1452- tracked = this . isTrackedCore ( fileName , repoPath === undefined ? '' : repoPath , ref ) ;
1453- if ( options . skipCacheUpdate ) return tracked ;
1453+ return tracked ;
1454+ }
14541455
1455- this . _trackedCache . set ( cacheKey , tracked ) ;
1456- tracked = await tracked ;
1457- this . _trackedCache . set ( cacheKey , tracked ) ;
1456+ tracked = this . isTrackedCore ( fileName , repoPath === undefined ? '' : repoPath , ref ) ;
1457+ if ( options . skipCacheUpdate ) {
1458+ tracked = await tracked ;
1459+
1460+ return tracked ;
1461+ }
14581462
1459- return tracked ;
1463+ this . _trackedCache . set ( cacheKey , tracked ) ;
1464+ tracked = await tracked ;
1465+ this . _trackedCache . set ( cacheKey , tracked ) ;
1466+
1467+ return tracked ;
1468+ }
1469+ finally {
1470+ Logger . log ( `isTracked('${ fileName } ', '${ repoPath } '${ ref !== undefined ? `, '${ ref } '` : '' } ) = ${ tracked } ` ) ;
1471+ }
14601472 }
14611473
14621474 private async isTrackedCore ( fileName : string , repoPath : string , ref ?: string ) {
0 commit comments