File tree Expand file tree Collapse file tree
extensions/ql-vscode/src/databases Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -114,11 +114,14 @@ export class DbConfigStore extends DisposableObject {
114114
115115 const config : DbConfig = cloneDbConfig ( this . config ) ;
116116 if ( parentList ) {
117- config . databases . remote . repositoryLists . forEach ( ( list ) => {
118- if ( list . name === parentList ) {
119- list . repositories . push ( repoNwo ) ;
120- }
121- } ) ;
117+ const parent = config . databases . remote . repositoryLists . find (
118+ ( list ) => list . name === parentList ,
119+ ) ;
120+ if ( ! parent ) {
121+ throw Error ( `Cannot find parent list '${ parentList } '` ) ;
122+ } else {
123+ parent . repositories . push ( repoNwo ) ;
124+ }
122125 } else {
123126 config . databases . remote . repositories . push ( repoNwo ) ;
124127 }
Original file line number Diff line number Diff line change @@ -79,13 +79,6 @@ export class DbManager {
7979 nwo : string ,
8080 parentList ?: string ,
8181 ) : Promise < void > {
82- if ( nwo === "" ) {
83- throw new Error ( "Repository name cannot be empty" ) ;
84- }
85- if ( this . dbConfigStore . doesRemoteDbExist ( nwo ) ) {
86- throw new Error ( `The repository '${ nwo } ' already exists` ) ;
87- }
88-
8982 await this . dbConfigStore . addRemoteRepo ( nwo , parentList ) ;
9083 }
9184
You can’t perform that action at this time.
0 commit comments