Fixed missing authentication on module update

This commit is contained in:
Abdelilah El Aissaoui 2023-05-25 23:57:04 +02:00
parent 8a48e51469
commit f98caf9890
No known key found for this signature in database
GPG Key ID: 7587FC860F594869

View File

@ -1,5 +1,6 @@
package com.jetpackduba.gitnuro.git.submodules package com.jetpackduba.gitnuro.git.submodules
import com.jetpackduba.gitnuro.git.remote_operations.HandleTransportUseCase
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.isActive import kotlinx.coroutines.isActive
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
@ -11,7 +12,9 @@ import javax.inject.Inject
private const val TAG = "UpdateSubmoduleUseCase" private const val TAG = "UpdateSubmoduleUseCase"
class UpdateSubmoduleUseCase @Inject constructor() { class UpdateSubmoduleUseCase @Inject constructor(
private val handleTransportUseCase: HandleTransportUseCase,
) {
suspend operator fun invoke(git: Git, path: String) = withContext(Dispatchers.IO) { suspend operator fun invoke(git: Git, path: String) = withContext(Dispatchers.IO) {
git.submoduleUpdate() git.submoduleUpdate()
.addPath(path) .addPath(path)
@ -30,6 +33,7 @@ class UpdateSubmoduleUseCase @Inject constructor() {
} }
} }
) )
.setTransportConfigCallback { handleTransportUseCase(it, git) }
.setProgressMonitor(object : ProgressMonitor { .setProgressMonitor(object : ProgressMonitor {
override fun start(totalTasks: Int) {} override fun start(totalTasks: Int) {}
override fun beginTask(title: String?, totalWork: Int) {} override fun beginTask(title: String?, totalWork: Int) {}