compareCommits method

Future<GitHubComparison> compareCommits(
  1. RepositorySlug slug,
  2. String refBase,
  3. String refHead
)

refBase and refHead can be the same value for a branch, commit, or ref in slug or specify other repositories by using repo:ref syntax.

API docs: https://developer.github.com/v3/repos/commits/#compare-two-commits

Implementation

Future<GitHubComparison> compareCommits(
  RepositorySlug slug,
  String refBase,
  String refHead,
) async {
  ArgumentError.checkNotNull(slug);
  ArgumentError.checkNotNull(refBase);
  ArgumentError.checkNotNull(refHead);
  return github.getJSON<Map<String, dynamic>, GitHubComparison>(
    '/repos/${slug.fullName}/compare/$refBase...$refHead',
    convert: (j) => GitHubComparison.fromJson(j),
  );
}