getReference method

Future<GitReference> getReference(
  1. RepositorySlug slug,
  2. String ref
)

Fetches a reference from a repository for the given ref.

Note: The ref in the URL must be formatted as "heads/branch", not just "branch".

API docs: https://developer.github.com/v3/git/refs/#get-a-reference

Implementation

Future<GitReference> getReference(RepositorySlug slug, String ref) =>
    github.getJSON('/repos/${slug.fullName}/git/refs/$ref',
        convert: (dynamic i) => GitReference.fromJson(i),
        statusCode: StatusCodes.OK);