fun autoCollapseBranch()

in src/main/kotlin/com/jetbrains/interactiveRebase/services/ActionService.kt [968:980]


    fun autoCollapseBranch(branch: BranchInfo?) {
        if (branch == null) return
        // expand first if there are nested collapses present
        val possibleParent = branch.currentCommits.find { it.isCollapsed }
        if (possibleParent != null) {
            expandCollapsedCommits(possibleParent, branch, enableNestedCollapsing = false)
            branch.isNestedCollapsed = false
        }

        if (branch.currentCommits.none { it.isCollapsed }) {
            branch.collapseCommits()
        }
    }