add Geef.Revwalk module for Elixir
This commit is contained in:
committed by
Carlos Martín Nieto
parent
01254f2f90
commit
79f89bcd41
@@ -1,12 +1,33 @@
|
||||
ExUnit.start
|
||||
|
||||
defmodule RepoHelpers do
|
||||
use Geef
|
||||
|
||||
def tmp_bare do
|
||||
{a, b, c} = :erlang.timestamp()
|
||||
n = node()
|
||||
dir = :io_lib.format("geef-~p~p~p~p.git", [n, a, b, c])
|
||||
path = Path.join(System.tmp_dir!, dir)
|
||||
{:ok, repo} = Geef.Repository.init(path, true)
|
||||
{:ok, repo} = Repository.init(path, true)
|
||||
{repo, path}
|
||||
end
|
||||
|
||||
def tmp_commit_line do
|
||||
{repo, path} = tmp_bare()
|
||||
sig = Signature.now("Geef Test", "test@geef")
|
||||
message = "commit message"
|
||||
{:ok, idx} = Index.new()
|
||||
{:ok, empty_index} = Index.write_tree(idx, repo)
|
||||
|
||||
{:ok, c} = Commit.create(repo, sig, sig, message, empty_index, [])
|
||||
{:ok, c} = Commit.create(repo, sig, sig, message, empty_index, [c])
|
||||
{:ok, c} = Commit.create(repo, sig, sig, message, empty_index, [c])
|
||||
boring_ancestor = c
|
||||
{:ok, c} = Commit.create(repo, sig, sig, message, empty_index, [c])
|
||||
{:ok, c} = Commit.create(repo, sig, sig, message, empty_index, [c])
|
||||
{:ok, c} = Commit.create(repo, sig, sig, message, empty_index, [c])
|
||||
head = c
|
||||
|
||||
{repo, path, head, boring_ancestor}
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user