Skip to main content

merge

Function merge 

Source
pub fn merge(
    obj_store: &mut GitObjectStore,
    commits_table: &mut CommitsTable,
    commit_a_id: &str,
    commit_b_id: &str,
    author: &str,
) -> Result<MergeResult, MergeError>
Expand description

Perform a 3-way merge between two commits.

  1. Find common ancestor
  2. Diff ancestor->A and ancestor->B
  3. Detect conflicts (same subject+predicate, different objects)
  4. If no conflicts, apply both diffs and create merge commit