getBranch method

Future<Branch> getBranch(
  1. RepositorySlug slug,
  2. String branch
)

Fetches the specified branch.

API docs: https://developer.github.com/v3/repos/#get-branch

Implementation

Future<Branch> getBranch(RepositorySlug slug, String branch) async {
  ArgumentError.checkNotNull(slug);
  ArgumentError.checkNotNull(branch);
  return github.getJSON<Map<String, dynamic>, Branch>(
    '/repos/${slug.fullName}/branches/$branch',
    convert: (i) => Branch.fromJson(i),
  );
}