Git.CherryPickResult (git v0.4.0)

Copy Markdown View Source

Represents the parsed result of a git cherry-pick command.

Returned by the cherry-pick command on a successful (exit code 0) pick operation. For abort, continue, and skip operations, {:ok, :done} is returned instead.

Summary

Functions

Parses the output of git cherry-pick into a Git.CherryPickResult struct.

Types

t()

@type t() :: %Git.CherryPickResult{conflicts: boolean(), raw: String.t()}

Functions

parse(output)

@spec parse(String.t()) :: t()

Parses the output of git cherry-pick into a Git.CherryPickResult struct.

Checks for the "CONFLICT" pattern in the output to detect merge conflicts.

Examples

iex> Git.CherryPickResult.parse("[main abc1234] cherry-picked commit\n 1 file changed, 1 insertion(+)\n")
%Git.CherryPickResult{conflicts: false, raw: "[main abc1234] cherry-picked commit\n 1 file changed, 1 insertion(+)\n"}