@@ -17,7 +17,7 @@ import {
1717 RepositoryState
1818} from "./common/types" ;
1919import { debounce } from "./decorators" ;
20- import { exists , readdir , stat } from "./fs" ;
20+ import { readdir , stat } from "./fs" ;
2121import { configuration } from "./helpers/configuration" ;
2222import { RemoteRepository } from "./remoteRepository" ;
2323import { Repository } from "./repository" ;
@@ -29,6 +29,7 @@ import {
2929 filterEvent ,
3030 IDisposable ,
3131 isDescendant ,
32+ isSvnFolder ,
3233 normalizePath
3334} from "./util" ;
3435import { matchAll } from "./util/globMatch" ;
@@ -219,34 +220,9 @@ export class Model implements IDisposable {
219220 return ;
220221 }
221222
222- let isSvnFolder = false ;
223+ const checkParent = level === 0 ;
223224
224- try {
225- isSvnFolder = await exists ( path + "/.svn" ) ;
226- } catch ( error ) {
227- // error
228- }
229-
230- // If open only a subpath.
231- if ( ! isSvnFolder && level === 0 ) {
232- const pathParts = path . split ( / [ \\ / ] / ) ;
233- while ( pathParts . length > 0 ) {
234- pathParts . pop ( ) ;
235- const topPath = pathParts . join ( "/" ) + "/.svn" ;
236-
237- try {
238- isSvnFolder = await exists ( topPath ) ;
239- } catch ( error ) {
240- // error
241- }
242-
243- if ( isSvnFolder ) {
244- break ;
245- }
246- }
247- }
248-
249- if ( isSvnFolder ) {
225+ if ( isSvnFolder ( path , checkParent ) ) {
250226 // Config based on folder path
251227 const resourceConfig = workspace . getConfiguration ( "svn" , Uri . file ( path ) ) ;
252228
0 commit comments