[jOOQ/jOOQ#9506] A Commits graph must be closed (i.e. a single graph)

All nodes in the graph must share the same root node.
This commit is contained in:
Lukas Eder 2023-06-14 10:39:43 +02:00
parent 8002bdc39f
commit bbb04e2848

View File

@ -90,6 +90,9 @@ final class CommitsImpl implements Commits {
@Override
public void add(Commit commit) {
if (root != commit.root())
throw new DataMigrationValidationException("A Commits graph must contain a single graph whose commits all share the same root.");
Commit duplicate;
if ((duplicate = commitsById.get(commit.id())) != null)