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

@@ -7,7 +7,7 @@ repo_test_() ->
{foreach, fun start/0, fun stop/1, [fun bare_test/1, fun odb_write_test/1,
fun ref_test/1, fun index_add_test/1,
fun ref_iter_test/1, fun revparse_test/1,
fun commit_create_test/1]}.
fun commit_create_test/1, fun commit_message_test/1]}.
start() ->
{A, B, C} = now(),
@@ -104,6 +104,13 @@ commit_create_test(Repo) ->
Resp = geef_commit:create(Repo, Sig, Message, TreeId, []),
[?_assertMatch({ok, CommitId}, Resp)].
commit_message_test(Repo) ->
commit_create_test(Repo),
CommitId = geef_oid:parse("bf968373f95f8fed2a24f9d25ebf06521359c6bc"),
{ok, Commit} = geef_commit:lookup(Repo, CommitId),
Resp = geef_commit:message(Commit),
[?_assertMatch({ok, <<"Commit message">>}, Resp)].
rm_r(Path) ->
case filelib:is_dir(Path) of
false ->