Skip to main content

cherry_pick

Function cherry_pick 

Source
pub fn cherry_pick(
    obj_store: &mut GitObjectStore,
    commits_table: &mut CommitsTable,
    source_commit_id: &str,
    head_commit_id: &str,
    author: &str,
) -> Result<String, CherryPickError>
Expand description

Cherry-pick a commit onto the current HEAD.

  1. Compute what the source commit changed (diff parent -> source)
  2. Check if any of those changes conflict with HEAD
  3. If clean, apply the diff and create a new commit

Returns the new commit’s ID.