             "sha": sha
             }),
           [{"Authorization", "token #{token}"}, {"Accept", @content_type}])
-      true -> :ok
+      true -> %{body: "", status_code: 200}
     end
     sha
   end

    %{body: raw, status_code: status_code} = HTTPoison.get!(
      "#{cfg[:site]}/repositories/#{repository_id}/branches/#{to}",
      [{"Authorization", "token #{token}"}, {"Accept", @content_type}])
    cond do
      status_code == 404 ->
        HTTPoison.post!(
          "#{cfg[:site]}/repositories/#{repository_id}/refs",


  def merge_branch!(token, repository_id, from, to, commit_message) when is_binary(token) do
    cfg = config()
    %{body: raw, status_code: 200} = HTTPoison.patch!(
      "#{cfg[:site]}/repositories/#{repository_id}/merges",
      Poison.encode!(%{
        "base": to,
