fun load()

in src/main/kotlin/git4ideaClasses/IRGitRebaseFile.kt [21:46]


    fun load(): List<IRGitEntry> {
        val encoding = GitConfigUtil.getLogEncoding(myProject, myRoot)
        val entries: MutableList<IRGitEntry> = ArrayList()
        val s = StringScanner(FileUtil.loadFile(myFile, encoding))
        var noop = false
        while (s.hasMoreData()) {
            if (s.isEol || isComment(s)) {
                s.nextLine()
                continue
            }
            if (s.startsWith("noop")) {
                noop = true
                s.nextLine()
                continue
            }
            val command = s.spaceToken()
            val hash = s.spaceToken()
            val comment = s.line()
            val action: IRGitEntry.Action = IRGitEntry.parseAction(command)
            entries.add(IRGitEntry(action, hash, comment))
        }
        if (noop && entries.isEmpty()) {
            throw NoopException()
        }
        return entries
    }