module GitHub::REST::References

Overview

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

Direct including types

Defined in:

githubcr/rest.cr

Instance Method Summary

Instance Method Detail

def 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.


[View source]
def delete_reference(owner : String, repository : String, reference : String) : Nil #

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


[View source]
def delete_reference_tag #

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


[View source]
def 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/ for branches and tags/ for tags. If the :ref doesn't exist in the repository, but existing refs start with :ref, they will be returned as an array.


[View source]
def get_reference(owner : String, repository : String, reference : String) : Ref #

Get a single Reference by it's ID


[View source]
def update_reference(owner : String, repository : String, payload : RefPatchPayload) : Ref #

[View source]