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

Parsed representation of a `git cherry` output line.

Each entry indicates whether a commit has been applied upstream
(cherry-picked) and includes the commit SHA and optionally the
subject line when verbose mode is used.

# `t`

```elixir
@type t() :: %Git.CherryEntry{
  applied: boolean(),
  sha: String.t(),
  subject: String.t() | nil
}
```

# `parse`

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

Parses the output of `git cherry` into a list of `Git.CherryEntry` structs.

Each line starts with `+` (not applied upstream) or `-` (already applied),
followed by a SHA. With `-v`, a subject line follows the SHA.

## Examples

    iex> Git.CherryEntry.parse("+ abc1234\n- def5678\n")
    [
      %Git.CherryEntry{applied: false, sha: "abc1234", subject: nil},
      %Git.CherryEntry{applied: true, sha: "def5678", subject: nil}
    ]

    iex> Git.CherryEntry.parse("+ abc1234 add feature\n- def5678 fix bug\n")
    [
      %Git.CherryEntry{applied: false, sha: "abc1234", subject: "add feature"},
      %Git.CherryEntry{applied: true, sha: "def5678", subject: "fix bug"}
    ]

    iex> Git.CherryEntry.parse("")
    []

---

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