@@ -56,18 +56,21 @@ protected override ValueTask DeleteCoreAsync(CancellationToken cancellationToken
5656 /// <inheritdoc />
5757 protected override async IAsyncEnumerable < VirtualNode > GetFileNodesCoreAsync ( [ EnumeratorCancellation ] CancellationToken cancellationToken )
5858 {
59- await foreach ( var node in _directory . GetFileNodesAsync ( cancellationToken ) . ConfigureAwait ( false ) )
59+ if ( _included )
6060 {
61- if ( ! _fs . IsExcluded ( node . FullName ) )
61+ await foreach ( var node in _directory . GetFileNodesAsync ( cancellationToken ) . ConfigureAwait ( false ) )
6262 {
63- if ( node is VirtualFile file )
64- {
65- if ( _fs . IsIncluded ( node . FullName ) )
66- yield return new GlobbingFile ( _fs , file , true ) ;
67- }
68- else
63+ if ( ! _fs . IsExcluded ( node . FullName ) )
6964 {
70- yield return new GlobbingDirectory ( _fs , ( VirtualDirectory ) node , true ) ;
65+ if ( node is VirtualFile file )
66+ {
67+ if ( _fs . IsIncluded ( node . FullName ) )
68+ yield return new GlobbingFile ( _fs , file , true ) ;
69+ }
70+ else
71+ {
72+ yield return new GlobbingDirectory ( _fs , ( VirtualDirectory ) node , true ) ;
73+ }
7174 }
7275 }
7376 }
@@ -76,20 +79,26 @@ protected override async IAsyncEnumerable<VirtualNode> GetFileNodesCoreAsync([En
7679 /// <inheritdoc />
7780 protected override async IAsyncEnumerable < VirtualFile > GetFilesCoreAsync ( [ EnumeratorCancellation ] CancellationToken cancellationToken )
7881 {
79- await foreach ( var file in _directory . GetFilesAsync ( cancellationToken ) . ConfigureAwait ( false ) )
82+ if ( _included )
8083 {
81- if ( _fs . IsFileIncluded ( file . FullName ) )
82- yield return new GlobbingFile ( _fs , file , true ) ;
84+ await foreach ( var file in _directory . GetFilesAsync ( cancellationToken ) . ConfigureAwait ( false ) )
85+ {
86+ if ( _fs . IsFileIncluded ( file . FullName ) )
87+ yield return new GlobbingFile ( _fs , file , true ) ;
88+ }
8389 }
8490 }
8591
8692 /// <inheritdoc />
8793 protected override async IAsyncEnumerable < VirtualDirectory > GetDirectoriesCoreAsync ( [ EnumeratorCancellation ] CancellationToken cancellationToken )
8894 {
89- await foreach ( var directory in _directory . GetDirectoriesAsync ( cancellationToken ) . ConfigureAwait ( false ) )
95+ if ( _included )
9096 {
91- if ( _fs . IsDirectoryIncluded ( directory . FullName ) )
92- yield return new GlobbingDirectory ( _fs , directory , true ) ;
97+ await foreach ( var directory in _directory . GetDirectoriesAsync ( cancellationToken ) . ConfigureAwait ( false ) )
98+ {
99+ if ( _fs . IsDirectoryIncluded ( directory . FullName ) )
100+ yield return new GlobbingDirectory ( _fs , directory , true ) ;
101+ }
93102 }
94103 }
95104}
0 commit comments