Add reference has_log()

This commit is contained in:
Carlos Martín Nieto
2014-02-13 10:47:14 +01:00
parent 42d0aef29d
commit 9501ed2377
7 changed files with 59 additions and 1 deletions

View File

@@ -18,6 +18,7 @@
-export([open/1, init/2, path/1, workdir/1, odb/1, is_bare/1, references/1, discover/1,
lookup_object/2, revwalk/1, stop/1,
reference_dwim/2, handle/1, iterator/2]).
-export([reference_has_log/2]).
-include("geef_records.hrl").
-record(state, {handle}).
@@ -95,11 +96,15 @@ reference_dwim(Pid, Name) ->
revwalk(Pid) ->
gen_server:call(Pid, revwalk).
%% @private
reference_has_log(Pid, Name) ->
gen_server:call(Pid, {has_log, Name}).
stop(Pid) ->
gen_server:call(Pid, stop).
%% @private
%% @doc Get the underlying repo resource6
%% @doc Get the underlying repo resource
handle(Pid) ->
gen_server:call(Pid, handle).
@@ -136,6 +141,11 @@ handle_call({iterator, Regexp}, _From, State = #state{handle=Handle}) ->
handle_call({dwim_reference, Name}, _From, State = #state{handle=Handle}) ->
Reply = geef_nif:reference_dwim(Handle, Name),
{reply, Reply, State};
handle_call({has_log, Name}, _From, State = #state{handle=Handle}) ->
Reply = geef_nif:reference_has_log(Handle, Name),
{reply, Reply, State};
handle_call(stop, _From, State) ->
{stop, normal, ok, State};
handle_call(revwalk, _From, State = #state{handle=Handle}) ->