module

GitHub::REST::References

This module is specifically for interacting with the Reference endpoints GitHub offers us to use. A Git reference (git ref) is just a file that contains a Git commit SHA-1 hash. When referring to a Git commit, you can use the Git reference, which is an easy-to-remember name, rather than the hash. The Git reference can be rewritten to point to a new commit. A branch is just a Git reference that stores the new Git commit hash. These endpoints allow you to read and write references to your Git database on GitHub. see GitHub Refs endpoints

Instance methods

create_reference(owner : String, repository : String, payload : RefPayload) : Ref

Creates a reference for your repository. You are unable to create new references for empty repositories, even if the commit SHA-1 hash used exists. Empty repositories are repositories without branches.

Source
delete_reference(owner : String, repository : String, reference : String) : Nil

NOTE: If this raises an error, you've failed to delete the reference.

Source
delete_reference_tag

TODO: Check out the endpoint since it's missing in the docs.

Source
get_matching_references(owner : String, repository : String, reference : String) : Array(Ref)

Returns an array of references from your Git database that match the supplied name. The :ref in the URL must be formatted as heads/<branch name> for branches and tags/<tag name> for tags. If the :ref doesn't exist in the repository, but existing refs start with :ref, they will be returned as an array.

Source
get_reference(owner : String, repository : String, reference : String) : Ref

Get a single Reference by it's ID

Source
update_reference(owner : String, repository : String, payload : RefPatchPayload) : Ref
Source