File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 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 {
378378 }
379379
380380 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 ) {
382388 const repository = liveRepository . repository ;
383389
390+ // Ignore path is not child (fix for multiple externals)
391+ if ( ! isDescendant ( repository . workspaceRoot , uri . fsPath ) ) {
392+ continue ;
393+ }
394+
384395 try {
385396 const path = normalizePath ( uri . fsPath ) ;
386397
387398 await repository . info ( path ) ;
388399
389400 return repository ;
390401 } catch ( error ) {
391- console . error ( ) ;
402+ // Ignore
392403 }
393404 }
394405
You can’t perform that action at this time.
0 commit comments