mirror of
https://github.com/dolthub/dolt.git
synced 2026-01-24 10:30:48 -06:00
This patch adds an optional MergePolicy field to CommitOptions. It's a callback. If the caller sets it, then the commit code will look for a common ancestor between the Dataset HEAD and the provided Commit. If the caller-provided Commit descends from HEAD, then Commit proceeds as normal. If it does not, but there is a common ancestor, the code runs merge.ThreeWay() on the values of the provided Commit, HEAD, and the common ancestor, invoking the MergePolicy callback to resolve conflicts. If merge succeeds, a merge Commit is created that descends from both HEAD and the caller-provided Commit. This becomes the new HEAD of the Dataset. Fixes #2534