Tentacat v1.2.0 Tentacat.References

Summary

Functions

create(client, owner, repo, body)

Specs

create(Tentacat.Client.t, binary, binary, list | map) :: Tentacat.response

Create a Reference

Reference body example:

%{
  "ref" => "refs/heads/emj-otp-18",
  "sha" => "aa218f56b14c9653891f9e74264a383fa43fefbd"
}

Example

Tentacat.References.create client, "elixir-lang", "elixir", ref_body

More info at: https://developer.github.com/v3/git/refs/#create-a-reference

find(client \\ %Client{}, owner, repo, ref)

Specs

find(Tentacat.Client.t, binary, binary, binary) :: Tentacat.response

Get a Reference

Example

Tentacat.References.find "elixir-lang", "elixir", "heads/emj-otp-18"
Tentacat.References.find client, "elixir-lang", "elixir", "heads/emj-otp-18"

More info at: https://developer.github.com/v3/git/refs/#get-a-reference

list(client \\ %Client{}, owner, repo)

Specs

list(Tentacat.Client.t, binary, binary) :: Tentacat.response

Get all References

Example

Tentacat.References.list "elixir-lang", "elixir"
Tentacat.References.list client, "elixir-lang", "elixir"

More info at: https://developer.github.com/v3/git/refs/#get-all-references

remove(client, owner, repo, ref)

Specs

remove(Tentacat.Client.t, binary, binary, binary) :: Tentacat.response

Delete a Reference

Example

Tentacat.References.remove client, "elixir-lang", "elixir", "heads/emj-otp-18"
Tentacat.References.remove client, "elixir-lang", "elixir", "tags/v1.0.2"

More info at: https://developer.github.com/v3/git/refs/#delete-a-reference

update(client, owner, repo, ref, body)

Specs

update(Tentacat.Client.t, binary, binary, binary, list | map) :: Tentacat.response

Update a Reference

Reference body example:

%{
  "sha"   => "aa218f56b14c9653891f9e74264a383fa43fefbd",
  "force" => true
}

Example

Tentacat.References.update client, "elixir-lang", "elixir", "heads/emj-otp-18", body

More info at: https://developer.github.com/v3/git/refs/#update-a-reference