returns false if no new commit
324639
private boolean checkCommit(GHPullRequest pr) {
        GHCommitPointer head = pr.getHead();
        GHCommitPointer base = pr.getBase();

        String headSha = head.getSha();
        String baseSha = base.getSha();

        if (StringUtils.equals(headSha, this.head) && StringUtils.equals(baseSha, this.base)) {
            return false;
        }

        LOGGER.log(Level.FINE,
                "New commit. Sha: Head[{0} => {1}] Base[{2} => {3}]",
                new Object[] {this.head, headSha, this.base, baseSha});

        setHead(headSha);
        setBase(baseSha);

        if (accepted) {
            shouldRun = true;
        }
        return true;
    }
226635
private function commit()
    {
        //====================================================================//
        // Safety Checks
        if (empty($this->new)) {
            return true;
        }
        //====================================================================//
        // Create Field List
        if (empty($this->blocks)) {
            $this->blocks = array();
        }
        //====================================================================//
        // Insert Field List
        $this->blocks[] = $this->new;
        $this->new = null;

        return true;
    }
680140
def buildcommit(self):
        
        # pylint: disable=len-as-condition
        if len(self.dutinformation) > 0 and (self.dutinformation.get(0).build is not None):
            return self.dutinformation.get(0).build.commit_id
        return None
1109771
def commit(self):
        '''
        
        '''
        providen, provstack = get()
        wasnew = (providen is None)
        if wasnew:
            providen = self.getProvIden(provstack)
            setiden(providen)
        return wasnew, s_common.ehex(providen), provstack
1020313
protected function CheckForUpdate() {
		global $pgIP;
		$data = json_decode( $this->http->get( 'https://api.github.com/repos/phpseclib/phpseclib/branches/master', null, array(), false ), true );
		$this->commits = $data;
		if( !file_exists( $pgIP . 'Includes' . DIRECTORY_SEPARATOR . 'phpseclibupdate' ) ) return false;
		$log = unserialize( file_get_contents( $pgIP . 'Includes' . DIRECTORY_SEPARATOR . 'phpseclibupdate' ) );
		if( isset( $data['commit']['sha'] ) && $log['commit']['sha'] != $data['commit']['sha'] ) {
			pecho( "Updating SSH class!\n\n", PECHO_NOTICE );
			return false;
		}
		return true;
	}
638439
def commit(self):  # pylint: disable=no-self-use
        """"""
        if self._config_changed:
            self._last_working_config = self._download_running_config()
            self._config_history.append(self._last_working_config)
            self._committed = True  # comfiguration was committed
            self._config_changed = False  # no changes since last commit :)
            return True  # this will be always true
            # since the changes are automatically applied
        self._committed = False  # make sure the _committed attribute is not True by any chance
        return False
718040
static boolean shouldUpdate(AmazonInfo newInfo, AmazonInfo oldInfo) {
        if (newInfo.getMetadata().isEmpty()) {
            logger.warn("Newly resolved AmazonInfo is empty, skipping an update cycle");
        } else if (!newInfo.equals(oldInfo)) {
            if (isBlank(newInfo.get(AmazonInfo.MetaDataKey.instanceId))) {
                logger.warn("instanceId is blank, skipping an update cycle");
                return false;
            } else if (isBlank(newInfo.get(AmazonInfo.MetaDataKey.localIpv4))) {
                logger.warn("localIpv4 is blank, skipping an update cycle");
                return false;
            } else {
                Set<String> newKeys = new HashSet<>(newInfo.getMetadata().keySet());
                Set<String> oldKeys = new HashSet<>(oldInfo.getMetadata().keySet());

                Set<String> union = new HashSet<>(newKeys);
                union.retainAll(oldKeys);
                newKeys.removeAll(union);
                oldKeys.removeAll(union);

                for (String key : newKeys) {
                    logger.info("Adding new metadata {}={}", key, newInfo.getMetadata().get(key));
                }

                for (String key : oldKeys) {
                    logger.info("Removing old metadata {}={}", key, oldInfo.getMetadata().get(key));
                }
            }

            return true;
        }
        return false;
    }
1333065
async function checkLastCommit() {
  debug('checking if the last commit message has explicit release instructions');
  const summary = await git.lastLog();
  const re = /^#release v(\d+\.\d+\.\d+)/;
  const match = summary.match(re);

  if (match) {
    const version = match[1];

    if (version) {
      return version;
    }
  }

  return undefined;
}
205307
def is_bare(self):
        
        # Make sure the local repository exists.
        self.create()
        # Check the global revision id of the working tree.
        try:
            output = self.context.capture('hg', 'id', silent=True)
            tokens = output.split()
            return int(tokens[0]) == 0
        except Exception:
            return False
1290881
protected function commitNeedNotification(Commit $commit)
    {
        if (!$commit->isSuccessful()) {
            return true;
        }

        //getProject()->getLatestCommit() actually contains the previous build
        $previousCommit = $commit->getProject()->getLatestCommit();

        return !$previousCommit || $previousCommit->getStatusCode() != $commit->getStatusCode();
    }
1245550
def all_prev_ordered(self, commit: Commit):
        
        # TODO: This method does a lot of work, choose correct data
        # structures to make it efficient.

        viewNo, ppSeqNo = commit.viewNo, commit.ppSeqNo

        if self.last_ordered_3pc == (viewNo, ppSeqNo - 1):
            # Last ordered was in same view as this COMMIT
            return True

        # if some PREPAREs/COMMITs were completely missed in the same view
        toCheck = set()
        toCheck.update(set(self.sentPrePrepares.keys()))
        toCheck.update(set(self.prePrepares.keys()))
        toCheck.update(set(self.prepares.keys()))
        toCheck.update(set(self.commits.keys()))
        for (v, p) in toCheck:
            if v < viewNo and (v, p) not in self.ordered:
                # Have commits from previous view that are unordered.
                return False
            if v == viewNo and p < ppSeqNo and (v, p) not in self.ordered:
                # If unordered commits are found with lower ppSeqNo then this
                # cannot be ordered.
                return False

        return True
1062031
function isDirty () {
  return pify(git.raw.bind(git))(['status', '-s'])
    .then((out) => {
      if (out && out.trim().length > 0) {
        throw new Error('Dirty git repo, aborting')
      }
    })
}
823736
private int processCommits(GitHubRepo repo) {
        int count = 0;
        Long existingCount = commitRepository.countCommitsByCollectorItemId(repo.getId());
        if (existingCount == 0) {
            List<Commit> newCommits = gitHubClient.getCommits();
            newCommits.forEach(c -> c.setCollectorItemId(repo.getId()));
            Iterable<Commit> saved = commitRepository.save(newCommits);
            count = saved != null ? Lists.newArrayList(saved).size() : 0;
        } else {
            Collection<Commit> nonDupCommits = gitHubClient.getCommits().stream()
                    .<Map<String, Commit>> collect(HashMap::new,(m,c)->m.put(c.getScmRevisionNumber(), c), Map::putAll)
                    .values();
            for (Commit commit : nonDupCommits) {
                LOG.debug(commit.getTimestamp() + ":::" + commit.getScmCommitLog());
                if (isNewCommit(repo, commit)) {
                    commit.setCollectorItemId(repo.getId());
                    commitRepository.save(commit);
                    count++;
                }
            }
        }
        LOG.info("-- Saved Commits = " + count);
        return count;
    }
466332
def _auto_commit(self):
        

        # Check if we are supposed to do an auto-commit
        if not self.auto_commit or self.auto_commit_every_n is None:
            return

        if self.count_since_commit >= self.auto_commit_every_n:
            self.commit()
625793
def commit_in_valid_branch?
      # If two refs are entirely different commit histories, the API responds
      # with a 404. Rescue Octokit::NotFound in this case.
      begin
        default_compare = @client.compare @repo[:full_name],
          @repo[:default_branch], @commit[:sha]
      rescue Octokit::NotFound
        default_compare = nil
      end

      # The compare status should be "identical" or "behind" if the commit is in
      # the default branch
      if default_compare.nil? ||
        !(%w(identical behind).include?(default_compare[:status]))

        # If the commit is not in the default branch, check the gh-pages branch
        begin
          gh_pages_compare = @client.compare @repo[:full_name], "gh-pages",
            @commit[:sha]
        rescue Octokit::NotFound
          gh_pages_compare = nil
        end
        return false if !gh_pages_compare
        return false if !%w(identical behind).include? gh_pages_compare [:status]
      end

      true
    end
816004
def validateCommit(self, commit: Commit, sender: str) -> bool:
        
        key = (commit.viewNo, commit.ppSeqNo)
        if not self.has_prepared(key):
            self.enqueue_commit(commit, sender)
            return False

        if self.commits.hasCommitFrom(commit, sender):
            raise SuspiciousNode(sender, Suspicions.DUPLICATE_CM_SENT, commit)

        # BLS multi-sig:
        pre_prepare = self.getPrePrepare(commit.viewNo, commit.ppSeqNo)
        why_not = self._bls_bft_replica.validate_commit(commit, sender, pre_prepare)

        if why_not == BlsBftReplica.CM_BLS_SIG_WRONG:
            self.logger.warning("{} discard Commit message from "
                                "{}:{}".format(self, sender, commit))
            raise SuspiciousNode(sender,
                                 Suspicions.CM_BLS_SIG_WRONG,
                                 commit)
        elif why_not is not None:
            self.logger.warning("Unknown error code returned for bls commit "
                                "validation {}".format(why_not))

        return True
1004076
def _has_commit(version, debug=False):
    
    if _has_tag(version, debug) or _has_branch(version, debug):
        return False
    cmd = sh.git.bake('cat-file', '-e', version)
    try:
        util.run_command(cmd, debug=debug)
        return True
    except sh.ErrorReturnCode:
        return False