Merge this pull request.

        :param str commit_message: (optional), message to be used for the
            merge commit
        :returns: bool
489086
def merge(self, commit_message='', sha=None):
        
        parameters = {'commit_message': commit_message}
        if sha:
            parameters['sha'] = sha
        url = self._build_url('merge', base_url=self._api)
        json = self._json(self._put(url, data=dumps(parameters)), 200)
        self.merge_commit_sha = json['sha']
        return json['merged']
887850
def last_commit_msg(self) -> str:
        
        last_msg: str = self.latest_commit().message.rstrip()
        LOGGER.debug('last msg: %s', last_msg)
        return last_msg
26306
def commit_index(self, message):
        
        tree_id = self.write_tree()

        args = ['commit-tree', tree_id, '-p', self.ref_head]

        # todo, this can end in a race-condition with other processes adding commits
        commit = self.command_exec(args, message)[0].decode('utf-8').strip()
        self.command_exec(['update-ref', self.ref_head, commit])

        return commit
82368
def have_active_commit(self):
        

        commit_state = sfs.file_or_default(sfs.cpjoin(self.base_path, 'active_commit'), None)
        if commit_state != None: return True
        return False
521678
def save(self, message):
        
        self.commit.message = message
        self.commit.tree = self.tree
        #TODO: store new blobs only
        for item in self.tree.items():
            self.repo.object_store.add_object(item.blob)
        self.repo.object_store.add_object(self.tree)

        # set HEAD to new commit
        self.repo.object_store.add_object(self.commit)
        self.repo.refs['refs/heads/master'] = self.commit.id
244682
def attempt_squash_merge(pr: PullRequestDetails
                         ) -> Union[bool, CannotAutomergeError]:
    
    url = ("https://api.github.com/repos/{}/{}/pulls/{}/merge"
           "?access_token={}".format(pr.repo.organization,
                                     pr.repo.name,
                                     pr.pull_id,
                                     pr.repo.access_token))
    data = {
        'commit_title': '{} (#{})'.format(pr.title, pr.pull_id),
        'commit_message': pr.body,
        'sha': pr.branch_sha,
        'merge_method': 'squash'
    }
    response = requests.put(url, json=data)

    if response.status_code == 200:
        # Merge succeeded.
        log('Merged PR#{} ({!r}):\n{}\n'.format(
            pr.pull_id,
            pr.title,
            indent(pr.body)))
        return True

    if response.status_code == 405:
        return CannotAutomergeError("Pull Request is not mergeable.")

    if response.status_code == 409:
        # Need to sync.
        return False

    raise RuntimeError('Merge failed. Code: {}. Content: {}.'.format(
        response.status_code, response.content))
418392
def commit(self, msg):
        
        self.logger.info('Commit config: {}'.format(msg))
        with Dir(self.data_path):
            self.cmd.check_assert('git add .')
            self.cmd.check_assert('git commit --allow-empty -m "{}"'.format(msg))
996470
def merge(directory, message, branch_label, rev_id, revisions):
    """"""
    _merge(directory, revisions, message, branch_label, rev_id)
121234
def from_commit_msg(commit_msg_str):
        
        context = GitContext()
        commit_msg_obj = GitCommitMessage.from_full_message(commit_msg_str)

        commit = GitCommit(context, commit_msg_obj)

        context.commits.append(commit)
        return context
421049
def merge_user_commits(cls, commits):
        
        user = None
        for commit in commits:
            if not user:
                user = commit
            else:
                if commit.committer_time > user.committer_time:
                    commit.line_count += user.line_count
                    user = commit
                else:
                    user.line_count += commit.line_count
        return user
40135
def _commit(self):
        

        params = {'commit': 'true'}

        response = self._do_request(
            self.UPDATE_ENDPOINT,
            params=params
        )

        if response and response.status_code == 200:
            logger.debug('Index commited')
            return None

        logger.warning('Fail to commite index')
785826
def has_sign_off?(commit_or_message)
      message = commit_or_message.is_a?(String) ? commit_or_message : commit_or_message.message
      if message =~ /^Signed-off-by: (.+)$/
        $1
      else
        nil
      end
    end
1171601
def get_last_commit_message(self):
        
        # Check if we are currently in a repo
        try:
            branch = self.active_branch
            return self.commit(branch).message
        except InvalidGitRepositoryError:
            print "Not in a git repo"
            return None
634660
def commit_file(self, message, path, content):
        
        if self.git_batch_commit:
            self.add_file(path, content)
            self.git_batch_commit_messages.append(message)
        else:
            with self.lock_write():
                if self.job_id:
                    self.read_tree(self.ref_head)

                self.add_file(path, content)

                return self.commit_index(message)
534092
def MergeMessage(
      self, source, destination,
      replace_message, replace_repeated):
    """"""
    _MergeMessage(
        self._root, source, destination, replace_message, replace_repeated)
1138361
def commit(self, message=None):
        

        flags = filters.Items()

        if self._status:
            flags.add_flags(self._status)

        if self._code_review is not None:
            flags.add_flags("code-review %s" % self._code_review)

        if self._verified is not None:
            flags.add_flags("verified %s" % self._verified)

        if message:
            flags.add_flags("message '%s'" % message)

        query = ['gerrit', 'review', str(flags), str(self._review)]

        results = self.client.exec_command(' '.join(query))
        stdin, stdout, stderr = results

        # NOTE(flaper87): Log error messages
        error = []
        for line in stderr:
            error.append(line)

        # True if success
        return not error
408254
def check_commit_message_non_ascii(message)
      check_label = 'Only ASCII characters'

      if message.ascii_only?
        Status.report(check_label, true)
      else
        Status.report(check_label, false)
        @errors.push('Commit messages may not contain non-ASCII characters')
      end
    end