in src/main/kotlin/com/jetbrains/interactiveRebase/services/RebaseInvoker.kt [92:109]
fun expandCurrentCommitsForSquashed() {
val commits = branchInfo.currentCommits.toMutableList()
for (commitInfo in branchInfo.currentCommits) {
for (command in commitInfo.getChangesAfterPick()) {
if (command is SquashCommand) {
val parentCommit = command.parentCommit
val parentIndex = commits.indexOfFirst { it == parentCommit }
commits.addAll(parentIndex, command.squashedCommits)
}
if (command is FixupCommand) {
val parentCommit = command.parentCommit
val parentIndex = commits.indexOfFirst { it == parentCommit }
commits.addAll(parentIndex, command.fixupCommits)
}
}
}
branchInfo.currentCommits = commits
}