diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/git/workspace/StageAllUseCase.kt b/src/main/kotlin/com/jetpackduba/gitnuro/git/workspace/StageAllUseCase.kt index 0b1e738..c1f9926 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/git/workspace/StageAllUseCase.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/git/workspace/StageAllUseCase.kt @@ -22,6 +22,9 @@ class StageAllUseCase @Inject constructor( * The setUpdate flag of the addCommand adds deleted files but not newly added when active */ private fun addAllExceptNew(git: Git, allExceptNew: List) { + if (allExceptNew.isEmpty()) + return + val addCommand = git .add() @@ -35,6 +38,9 @@ class StageAllUseCase @Inject constructor( } private fun addNewFiles(git: Git, newFiles: List) { + if (newFiles.isEmpty()) + return + val addCommand = git .add()