File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
main/kotlin/org/modelix/model/server/handlers
test/kotlin/org/modelix/model/server/handlers Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -181,7 +181,7 @@ class RepositoriesManager(val client: LocalModelClient) : IRepositoriesManager {
181
181
}
182
182
183
183
fun getBranchNames (repositoryId : RepositoryId ): Set <String > {
184
- return store.getGenericStore()[branchListKey(repositoryId)]?.lines()?.toSet().orEmpty()
184
+ return store.getGenericStore()[branchListKey(repositoryId)]?.ifEmpty { null }?. lines()?.toSet().orEmpty()
185
185
}
186
186
187
187
override fun getBranches (repositoryId : RepositoryId ): Set <BranchReference > {
Original file line number Diff line number Diff line change @@ -26,6 +26,16 @@ class RepositoriesManagerTest {
26
26
store.close()
27
27
}
28
28
29
+ @Test
30
+ fun `deleting default branch works` () = runTest {
31
+ val repoId = RepositoryId (" branch-removal" )
32
+ initRepository(repoId)
33
+ repoManager.removeBranches(repoId, setOf (" master" ))
34
+ val branches = repoManager.getBranches(repoId)
35
+
36
+ assertTrue { branches.none { it.branchName == " master" } }
37
+ }
38
+
29
39
@Test
30
40
fun `repository data is removed when removing repository` () = runTest {
31
41
val repoId = RepositoryId (" abc" )
You can’t perform that action at this time.
0 commit comments