[github] avoid processing the same subgraph multiple times

#IJPL-160204 Fixed

(cherry picked from commit f449ea4351689c3dac3b0ea23327addc30e25c1e)

GitOrigin-RevId: acb969f34fa2e24347ef1aeeecdb71575d9a9571
This commit is contained in:
Ivan Semenov
2025-01-31 14:26:00 +01:00
committed by intellij-monorepo-bot
parent 1777cd515d
commit b2681c056c

View File

@@ -142,7 +142,10 @@ private fun sortCommits(commits: Collection<GHCommit>, lastCommitSha: String): L
}
checkNotNull(lastCommit) { "Could not determine last commit" }
val processedCommits = mutableSetOf<String>()
fun ImmutableGraph.Builder<GHCommit>.addCommits(commit: GHCommit) {
val alreadyProcessed = processedCommits.add(commit.oid)
if (alreadyProcessed) return
addNode(commit)
for (parent in commit.parents) {
val parentCommit = commitsBySha[parent.oid]