Paremetrize reference

This commit is contained in:
Carlos Martín Nieto
2013-01-21 12:22:41 +01:00
parent ff2b868526
commit 345048301c
3 changed files with 22 additions and 2 deletions

View File

@@ -3,7 +3,10 @@
{description, ""},
{vsn, "0.0.1"},
{modules, [
geef, repository, odb
geef,
repository,
odb,
reference
]},
{registered, []},
{applications, [

9
src/reference.erl Normal file
View File

@@ -0,0 +1,9 @@
-module(reference, [Handle]).
-export([resolve/0]).
resolve() ->
case geef:reference_resolve(Handle) of
{ok, Ref} ->
reference:new(Ref);
other -> other
end.

View File

@@ -1,5 +1,5 @@
-module(repository, [Handle]).
-export([path/0, workdir/0, bare/0, references/0]).
-export([path/0, workdir/0, bare/0, references/0, odb/0, lookup/1]).
path() ->
geef:repository_get_path(Handle).
@@ -20,3 +20,11 @@ odb() ->
other ->
other
end.
lookup(Refname) ->
case geef:repositiory_lookup_reference(Handle, Refname) of
{ok, Ref} ->
reference:new(Ref);
other ->
other
end.