index.js
function checkBuildCommit(build, localCommit) {
  const buildCommit = build.commit;
  let message = `Build commit ${buildCommit.sha
  } does not match ${localCommit.sha}`;
  if (localCommit.name) {
    message += ` (${localCommit.name})`;
  }
  // assert gives us useful exception properties for callers
  assert.strictEqual(
    buildCommit.sha,
    localCommit.sha,
    message
  );
  return build;
}
function checkBuildCommit(build, localCommit) {
  const buildCommit = build.commit;
  let message = `Build commit ${buildCommit.sha
  } does not match ${localCommit.sha}`;
  if (localCommit.name) {
    message += ` (${localCommit.name})`;
  }
  // assert gives us useful exception properties for callers
  assert.strictEqual(
    buildCommit.sha,
    localCommit.sha,
    message
  );
  return build;
}
Checks that a build has an expected commit hash.
@param {!{commit:!{sha: string}}} build Build (or branch) object returned
by the Travis CI API.
@param {!{sha: string, name: ?string}} localCommit Expected commit
information.
@return {!Object} <code>build</code>
@throws AssertionError If <code>build.commit.sha</code> is not equal to
<code>expected</code>.