Gitnuro/src/main/kotlin/app/git/stash/ApplyStashUseCase.kt
2022-08-26 05:46:03 +02:00

15 lines
444 B
Kotlin

package app.git.stash
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import org.eclipse.jgit.api.Git
import org.eclipse.jgit.revwalk.RevCommit
import javax.inject.Inject
class ApplyStashUseCase @Inject constructor() {
suspend operator fun invoke(git: Git, stashInfo: RevCommit): Unit = withContext(Dispatchers.IO) {
git.stashApply()
.setStashRef(stashInfo.name)
.call()
}
}