Fix compilation errors with Elixir 0.13.0

This commit is contained in:
Klaus Trainer
2014-04-22 15:03:43 +02:00
parent fcec57c84f
commit 2b4e2eec01
8 changed files with 20 additions and 7 deletions

View File

@@ -32,7 +32,7 @@ defmodule Geef.Commit do
def tree!(commit = Object[type: :commit]), do: tree(commit) |> Geef.assert_ok
@spec create(pid, Signature.t, Signature.t, iolist, Oid.t, [Oid.t], [:proplists.property()]) :: {:ok, Oid.t} | {:error, term}
def create(repo, author = Signature[], committer = Signature[], message, tree, parents, opts // []) do
def create(repo, author = Signature[], committer = Signature[], message, tree, parents, opts \\ []) do
:geef_commit.create(repo, Signature.to_erl(author), Signature.to_erl(committer), message, tree, parents, opts)
end

View File

@@ -1,6 +1,7 @@
require Record
defmodule Geef.Index do
use Geef
alias Geef.Index
alias Geef.Index.Entry
defmacrop to_erl(entry) do

View File

@@ -1,3 +1,5 @@
require Record
defrecord Geef.Iterator, Record.extract(:geef_iterator, from: "src/geef_records.hrl") do
alias Geef.Iterator
alias Geef.Reference

View File

@@ -1,3 +1,5 @@
require Record
defrecord Geef.Object, Record.extract(:geef_object, from: "src/geef_records.hrl") do
@doc false

View File

@@ -1,3 +1,5 @@
require Record
defrecord Geef.Request, Record.extract(:geef_request, from: "src/geef_records.hrl")
defmodule Geef.Pkt do

View File

@@ -1,3 +1,5 @@
require Record
defrecord Geef.Reference, Record.extract(:geef_reference, from: "src/geef_records.hrl") do
import Geef
alias Geef.Reference
@@ -8,16 +10,16 @@ defrecord Geef.Reference, Record.extract(:geef_reference, from: "src/geef_record
defp maybe_ref({:ok, ref}), do: {:ok, Reference.from_erl ref}
defp maybe_ref(err = {:error, _}), do: err
def create(repo, name, target, force // :false) do
def create(repo, name, target, force \\ :false) do
:geef_ref.create(repo, name, target, force) |> maybe_ref
end
def create!(repo, name, target, force // :false) do
def create!(repo, name, target, force \\ :false) do
create(repo, name, target, force) |> assert_ok
end
def create_symbolic(repo, name, target, force // :false) do
def create_symbolic(repo, name, target, force \\ :false) do
:geef_ref.create(repo, name, target, force) |> maybe_ref
end
def create_symbolic!(repo, name, target, force // :false) do
def create_symbolic!(repo, name, target, force \\ :false) do
create(repo, name, target, force) |> assert_ok
end
@@ -37,7 +39,7 @@ defrecord Geef.Reference, Record.extract(:geef_reference, from: "src/geef_record
:geef_ref.shorthand(name)
end
def iterator(repo, regexp // :undefined) do
def iterator(repo, regexp \\ :undefined) do
case :geef_ref.iterator(repo, regexp) do
{:ok, iter} ->
{:ok, Geef.Iterator.from_erl iter}

View File

@@ -1,3 +1,5 @@
require Record
defrecord Geef.Signature, Record.extract(:geef_signature, from: "src/geef_records.hrl") do
def now(name, email), do: :geef_sig.now(name, email) |> from_erl

View File

@@ -1,3 +1,5 @@
require Record
defrecord Geef.TreeEntry, Record.extract(:geef_tree_entry, from: "src/geef_records.hrl") do
@spec from_erl(term()) :: t
def from_erl(obj) do