   Parses the output of `git ls-remote` and returns a mapping
   of remote references and their sha1 values.
   """
+  @spec parse_refs({:ok, String.t}) :: %{String.t => hash_t}
+  def parse_refs({:ok, refs}), do: parse_refs(refs)
   @spec parse_refs(String.t) :: %{String.t => hash_t}
-  def parse_refs({:ok, refs}), do: parse_refs(refs)
   def parse_refs(refs) do
     refs
     |> String.split("\n")

    # this filters the origin address information (without \t)
    |> Stream.filter(&match?([_,_], &1))
    |> Stream.filter(fn [_ref, k] -> k != "HEAD" end)
    |> Stream.map(fn [ref, k] -> {k, ref} end)
    |> Enum.into(%{})
  end


  @spec update_from_remote(Git.Repository.t, Git.Repository.t, String.t, hash_t) :: :ok
  def update_from_remote(repo, remote_repo, ref, sha) do
    {:ok, _} = Git.fetch(repo, [remote_repo.path, "+" <> ref])
    {:ok, _} = Git.checkout(repo, [sha]) # |> IO.inspect
    :ok
  end

