Convenience functions for GitHub's Git reference REST API.
References identify branch heads and tags. Read and delete operations accept
either a relative reference such as "heads/main" or a fully qualified one
such as "refs/heads/main". Create operations likewise accept either form
in attrs.ref and send GitHub the required fully qualified refs/... value.
These thin wrappers return the same {:ok, body, meta} / {:error, reason}
shape as GhEx.REST and pass opts through to Req.
Summary
Functions
Creates a Git reference pointing at a commit SHA.
Deletes a Git reference.
Gets one Git reference.
Functions
@spec create_ref(GhEx.Client.t(), String.t(), String.t(), map(), keyword()) :: GhEx.REST.result()
Creates a Git reference pointing at a commit SHA.
attrs contains ref and sha. The reference may be relative
("heads/feature" or "tags/v1.0.0") or fully qualified; the request body
always uses GitHub's required "refs/..." form.
@spec delete_ref(GhEx.Client.t(), String.t(), String.t(), String.t(), keyword()) :: GhEx.REST.result()
Deletes a Git reference.
ref accepts the same relative or fully qualified forms as get_ref/5.
GitHub refuses to delete the repository's default branch.
@spec get_ref(GhEx.Client.t(), String.t(), String.t(), String.t(), keyword()) :: GhEx.REST.result()
Gets one Git reference.
ref is a branch or tag path such as "heads/main", "tags/v1.0.0", or
either form prefixed with "refs/".