Work towards elixir 14
While here, make the object be an elixir struct instead of delegating to the erlang code. As part of this, geef_nif:commit_tree() has been fixed to return the id, insted of the type, as we know it's going to be a tree, but not then id.
This commit is contained in:
@@ -14,8 +14,8 @@ tree_id(#geef_object{type=commit,handle=Handle}) ->
|
||||
-spec tree(commit()) -> {ok, geef_tree:tree()} | {error, term()}.
|
||||
tree(#geef_object{type=commit,handle=Handle}) ->
|
||||
case geef_nif:commit_tree(Handle) of
|
||||
{ok, Type, Handle} ->
|
||||
{ok, #geef_object{type=Type, handle=Handle}};
|
||||
{ok, Id, Handle} ->
|
||||
{ok, #geef_object{id=Id, handle=Handle}};
|
||||
Other ->
|
||||
Other
|
||||
end.
|
||||
|
||||
Reference in New Issue
Block a user