Add a way to look up objects
This commit is contained in:
14
src/geef_object.erl
Normal file
14
src/geef_object.erl
Normal file
@@ -0,0 +1,14 @@
|
||||
-module(geef_object).
|
||||
|
||||
-include("geef_records.hrl").
|
||||
|
||||
-export([lookup/2]).
|
||||
|
||||
-spec lookup(repo(), oid()) -> object().
|
||||
lookup(#repo{handle=Repo}, #oid{oid=Oid}) ->
|
||||
case geef:object_lookup(Repo, Oid) of
|
||||
{ok, Type, Handle} ->
|
||||
#object{type=Type, handle=Handle};
|
||||
Other ->
|
||||
Other
|
||||
end.
|
||||
Reference in New Issue
Block a user