Allow retrieval of a commit message

This commit is contained in:
Carlos Martín Nieto
2014-12-29 10:02:29 +00:00
parent e8b3b19d0d
commit ad9acd2356
7 changed files with 46 additions and 1 deletions

View File

@@ -31,4 +31,12 @@ defmodule Geef.Commit do
:geef_commit.create(repo, Signature.to_record(author), Signature.to_record(committer), message, tree, parents, opts)
end
@spec message(t) :: {:ok, String.t} | {:error, term}
def message(%Object{type: :commit, handle: handle}) do
:geef_nif.commit_message(handle)
end
@spec message!(t) :: String.t
def message!(commit), do: message(commit) |> Geef.assert_ok
end