From 1a79093274782a6469461ef361437178ecbb032a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Fri, 14 Feb 2014 00:40:48 +0100 Subject: [PATCH] Get rid of a few dialyzer warnings --- src/geef_oid.erl | 2 +- src/geef_ref.erl | 6 +++--- src/geef_sig.erl | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/geef_oid.erl b/src/geef_oid.erl index 90c1406..f34974f 100644 --- a/src/geef_oid.erl +++ b/src/geef_oid.erl @@ -18,7 +18,7 @@ hex(Oid) -> geef_nif:oid_fmt(Oid). %% @doc Parse an iolist as a hash --spec parse(iolist()) -> geef_oid:oid(). +-spec parse(iolist() | binary()) -> geef_oid:oid(). parse(Sha) -> geef_nif:oid_parse(Sha). diff --git a/src/geef_ref.erl b/src/geef_ref.erl index d4ad65d..51139e7 100644 --- a/src/geef_ref.erl +++ b/src/geef_ref.erl @@ -8,7 +8,7 @@ -type iterator() :: #geef_iterator{type :: ref}. -type type() :: oid | symbolic. -type target() :: binary() | geef_oid:oid(). --type ref() :: #geef_reference{name :: binary()}. +-type ref() :: #geef_reference{repo :: pid(), name :: binary()}. -export_type([reference/0, type/0, target/0, iterator/0]). -spec create(pid(), iolist(), geef_oid:oid(), boolean()) -> {ok, ref()} | {error, term()}. @@ -106,10 +106,10 @@ shorthand(#geef_reference{name=Name}) -> shorthand(Name). %% @doc Return whether the reference has a reflog --spec has_log(pid(), iolist()) -> {ok, boolean()} | {error, term()}. +-spec has_log(pid(), iolist() | binary()) -> {ok, boolean()} | {error, term()}. has_log(Repo, Name) -> geef_repo:reference_has_log(Repo, Name). --spec has_log(ref()) -> boolean() | {ok, boolean()} | {error | term()}. +-spec has_log(ref()) -> {ok, boolean()} | {error, term()}. has_log(#geef_reference{repo=Repo, name=Name}) -> has_log(Repo, Name). diff --git a/src/geef_sig.erl b/src/geef_sig.erl index d8bab2f..91e8f38 100644 --- a/src/geef_sig.erl +++ b/src/geef_sig.erl @@ -34,7 +34,7 @@ now(Name, Email) -> %% @private %% @doc convert the return from the NIF to a signature --spec convert(binary(), binary(), non_neg_integer(), non_neg_integer()) -> signature(). +-spec convert(iolist(), iolist(), non_neg_integer(), non_neg_integer()) -> signature(). convert(Name, Email, Timestamp, Offset) -> Time = {{Timestamp div 1000000, Timestamp rem 1000000, 0}, Offset}, #geef_signature{name=Name, email=Email, time=Time}.