Removed unnecessary filter to remote branches

This commit is contained in:
Abdelilah El Aissaoui 2023-04-17 20:29:45 +02:00
parent 0d14396ccf
commit 343da198b9
No known key found for this signature in database
GPG Key ID: 7587FC860F594869

View File

@ -68,16 +68,9 @@ class RemotesViewModel @AssistedInject constructor(
} }
private suspend fun loadRemotes(git: Git) = withContext(Dispatchers.IO) { private suspend fun loadRemotes(git: Git) = withContext(Dispatchers.IO) {
val remotes = git.remoteList()
.call()
val allRemoteBranches = getRemoteBranchesUseCase(git) val allRemoteBranches = getRemoteBranchesUseCase(git)
val remoteInfoList = remotes.map { remoteConfig -> val remoteInfoList = getRemotesUseCase(git, allRemoteBranches)
val remoteBranches = allRemoteBranches.filter { branch ->
branch.name.startsWith("refs/remotes/${remoteConfig.name}")
}
RemoteInfo(remoteConfig, remoteBranches)
}
val remoteViewList = remoteInfoList.map { remoteInfo -> val remoteViewList = remoteInfoList.map { remoteInfo ->
RemoteView(remoteInfo, true) RemoteView(remoteInfo, true)