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

@@ -1,6 +1,7 @@
-module(geef_commit).
-export([tree_id/1, tree/1, lookup/2]).
-export([create/5, create/6, create/7]).
-export([message/1]).
-include("geef_records.hrl").
@@ -53,3 +54,7 @@ create(Repo, Person = #geef_signature{}, Message, Tree, Parents, Opts) ->
create(Repo, Person = #geef_signature{}, Message, Tree, Parents) ->
create(Repo, Person, Person, Message, Tree, Parents, []).
-spec message(commit()) -> {ok, binary()} | {error, term()}.
message(#geef_object{type=commit,handle=Handle}) ->
geef_nif:commit_message(Handle).

View File

@@ -115,6 +115,10 @@ commit_tree(_Handle) ->
commit_create(_RepoHandle, _Ref, _Author, _Committer, _Encoding, _Message, _Tree, _Parents) ->
?NIF_FN.
-spec commit_message(term) -> binary().
commit_message(_CommitHandle) ->
?NIF_FN.
-spec tree_bypath(term, iolist()) -> term().
tree_bypath(_TreeHandle, _Path) ->
nif_error(?LINE).