text: public override Repository Open(C req, string name){if (IsUnreasonableName(name)){throw new RepositoryNotFoundException(name);}Repository db = exports.Get(NameWithDotGit(name));if (db != null){db.IncrementOpen();return db;}foreach (FilePath @base in exportBase){FilePath dir = RepositoryCache.FileKey.Resolve(new FilePath(@base, name), FS.DETECTED);if (dir == null){continue;}try{RepositoryCache.FileKey key = RepositoryCache.FileKey.Exact(dir, FS.DETECTED);db = RepositoryCache.Open(key, true);}catch (IOException e){throw new RepositoryNotFoundException(name, e);}try{if (IsExportOk(req, name, db)){return db;}else{throw new ServiceNotEnabledException();}}catch (RuntimeException e){db.Close();throw new RepositoryNotFoundException(name, e);}catch (IOException e){db.Close();throw new RepositoryNotFoundException(name, e);}catch (ServiceNotEnabledException e){db.Close();throw;}}if (exportBase.Count == 1){FilePath dir = new FilePath(exportBase.Iterator().Next(), name);throw new RepositoryNotFoundException(name, new RepositoryNotFoundException(dir));}throw new RepositoryNotFoundException(name);}