Commit 3aa381f 1 parent 5d72faf commit 3aa381f Copy full SHA for 3aa381f
File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -378,17 +378,28 @@ export class Model implements IDisposable {
378
378
}
379
379
380
380
public async getRepositoryFromUri ( uri : Uri ) : Promise < Repository | null > {
381
- for ( const liveRepository of this . openRepositories ) {
381
+
382
+ // Sort by path length (First external and ignored over root)
383
+ const open = this . openRepositories . sort (
384
+ ( a , b ) => b . repository . workspaceRoot . length - a . repository . workspaceRoot . length
385
+ ) ;
386
+
387
+ for ( const liveRepository of open ) {
382
388
const repository = liveRepository . repository ;
383
389
390
+ // Ignore path is not child (fix for multiple externals)
391
+ if ( ! isDescendant ( repository . workspaceRoot , uri . fsPath ) ) {
392
+ continue ;
393
+ }
394
+
384
395
try {
385
396
const path = normalizePath ( uri . fsPath ) ;
386
397
387
398
await repository . info ( path ) ;
388
399
389
400
return repository ;
390
401
} catch ( error ) {
391
- console . error ( ) ;
402
+ // Ignore
392
403
}
393
404
}
394
405
You can’t perform that action at this time.
0 commit comments