Wrap git_revparse_single
This commit is contained in:
@@ -178,6 +178,10 @@ signature_new(_Name, _Email) ->
|
||||
signature_new(_Name, _Email, _Time) ->
|
||||
?NIF_FN.
|
||||
|
||||
-spec revparse_single(term(), iolist()) -> {ok, term(), atom(), geef_oid:oid()} | {error, term()}.
|
||||
revparse_single(_Handle, _Str) ->
|
||||
?NIF_FN.
|
||||
|
||||
nif_error(Line) ->
|
||||
erlang:nif_error({nif_not_loaded,module,?MODULE,line,Line}).
|
||||
|
||||
|
||||
15
src/geef_revparse.erl
Normal file
15
src/geef_revparse.erl
Normal file
@@ -0,0 +1,15 @@
|
||||
-module(geef_revparse).
|
||||
|
||||
-include("geef_records.hrl").
|
||||
|
||||
-export([single/2]).
|
||||
|
||||
-spec single(pid(), iolist()) -> {ok, geef_obj:object()} | {error, term()}.
|
||||
single(Repo, Str) ->
|
||||
RepoHandle = geef_repo:handle(Repo),
|
||||
case geef_nif:revparse_single(RepoHandle, Str) of
|
||||
{ok, ObjHandle, Type, Id} ->
|
||||
{ok, #geef_object{type=Type, id=Id, handle=ObjHandle}};
|
||||
Error = {error, _} ->
|
||||
Error
|
||||
end.
|
||||
Reference in New Issue
Block a user