Skip to main content

squash_merge_diff

Function squash_merge_diff 

Source
pub async fn squash_merge_diff(
    repo_path: PathBuf,
    source_branch: String,
    target_branch: String,
) -> Result<String, GitError>
Expand description

Re-exported squash-merge APIs. Returns the full patch diff that will be squashed when merging a source branch into a target branch.

Uses git diff <target>..<source>.

§Arguments

  • repo_path - Path to the git repository root
  • source_branch - Name of the branch being merged
  • target_branch - Name of the branch receiving the squash merge

§Returns

The full patch diff for the squash merge range.

§Errors

Returns an error if invoking git fails or git diff exits with a non-zero status.