# `Git.MergeResult`
[🔗](https://github.com/joshrotenberg/git_wrapper_ex/blob/main/lib/git/merge_result.ex#L1)

Represents the parsed result of a `git merge` command.

Returned by `Git.merge/2` on a successful merge. For `--abort`
operations, `{:ok, :done}` is returned instead.

# `t`

```elixir
@type t() :: %Git.MergeResult{already_up_to_date: boolean(), fast_forward: boolean()}
```

# `parse`

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

Parses the output of `git merge` into a `Git.MergeResult` struct.

Handles the following output patterns:

  - `"Fast-forward"` — the merge was a fast-forward
  - `"Already up to date."` — nothing to merge
  - `"Merge made by the ..."` — a merge commit was created

## Examples

    iex> Git.MergeResult.parse("Updating abc1234..def5678\nFast-forward\n 1 file changed, 1 insertion(+)\n")
    %Git.MergeResult{fast_forward: true, already_up_to_date: false}

    iex> Git.MergeResult.parse("Already up to date.\n")
    %Git.MergeResult{fast_forward: false, already_up_to_date: true}

    iex> Git.MergeResult.parse("Merge made by the 'ort' strategy.\n 1 file changed, 1 insertion(+)\n")
    %Git.MergeResult{fast_forward: false, already_up_to_date: false}

---

*Consult [api-reference.md](api-reference.md) for complete listing*
