Gitnuro/src/main/kotlin/app/git/rebase/AbortRebaseUseCase.kt
2022-08-30 05:05:57 +02:00

15 lines
436 B
Kotlin

package app.git.rebase
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import org.eclipse.jgit.api.Git
import org.eclipse.jgit.api.RebaseCommand
import javax.inject.Inject
class AbortRebaseUseCase @Inject constructor() {
suspend operator fun invoke(git: Git): Unit = withContext(Dispatchers.IO) {
git.rebase()
.setOperation(RebaseCommand.Operation.ABORT)
.call()
}
}