Add lookup/2 to the specific types
They proxy to geef_object:lookup/3 which looks up the object and asserts the type.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
-module(geef_commit).
|
||||
-export([tree_id/1, tree/1, id/1]).
|
||||
-export([tree_id/1, tree/1, id/1, lookup/2]).
|
||||
|
||||
-include("geef_records.hrl").
|
||||
|
||||
@@ -16,5 +16,9 @@ tree(#object{type=commit,handle=Handle}) ->
|
||||
Other
|
||||
end.
|
||||
|
||||
-spec lookup(repo(), oid() | iolist()) -> object().
|
||||
lookup(Repo, Id) ->
|
||||
geef_object:lookup(Repo, Id, commit).
|
||||
|
||||
id(Obj = #object{type=commit}) ->
|
||||
geef_object:id(Obj).
|
||||
|
||||
Reference in New Issue
Block a user