Lazy commit request getter.
346709
def get_commit_req(self):
        """"""
        if not self.commit_req:
            self.commit_req = datastore.CommitRequest()
            self.commit_req.transaction = self.tx
        return self.commit_req
534782
@RequestMapping(value = "{projectId}/commit-info/{commit}", method = RequestMethod.GET)
    public Resource<OntrackGitCommitInfo> commitProjectInfo(@PathVariable ID projectId, @PathVariable String commit) {
        return Resource.of(
                gitService.getCommitProjectInfo(projectId, commit),
                uri(on(getClass()).commitProjectInfo(projectId, commit))
        ).withView(Build.class);
    }
1026408
def fetch_commit(commit_id)
      found = commits.find do |commit|
        commit["sha"] == commit_id
      end
      if found
        stringify_keys_deep(found.to_hash)
      else
        # cache miss; don't add to @commits because unsure of order.
        check_github_response do
          commit = @client.commit(user_project, commit_id)
          commit = stringify_keys_deep(commit.to_hash)
          commit
        end
      end
    end
425182
function request(refs, opts, callback) {
  var url = fmt(format, endpoint, cache.user, cache.repo, refs);

  got.get(url, opts, function(err, res) {
    res = res ? JSON.parse(res) : {};
    if (res.ref === refs) {
      callback(null, true);
      return;
    }

    callback(null, false);
  });
}
1066502
def commit(self, timeout=None, metadata=None, credentials=None):
        """"""
        if not self._common_commit():
            return

        new_metadata = self._dg.add_login_metadata(metadata)
        try:
            self._dc.commit_or_abort(self._ctx, timeout=timeout,
                                     metadata=new_metadata,
                                     credentials=credentials)
        except Exception as error:
            if util.is_jwt_expired(error):
                self._dg.retry_login()
                new_metadata = self._dg.add_login_metadata(metadata)
                try:
                    self._dc.commit_or_abort(self._ctx, timeout=timeout,
                                             metadata=new_metadata,
                                             credentials=credentials)
                except Exception as error:
                    return self._common_except_commit(error)

            self._common_except_commit(error)
1040295
def update(self, commit=True, **kwargs):
        

        for (attr, value) in kwargs.iteritems():
            setattr(self, attr, value)
        return commit and self.save() or self
1368213
def get_commits(self):
        '''
        
        '''
        if not self.is_managed_by_git():
            return []
        return self.git.get_commits(self.content.source_path, self.follow)
1293205
def commit(self, id, impreq): # pylint: disable=invalid-name,redefined-builtin
        
        schema = RequestSchema()
        json = self.service.encode(schema, impreq)

        schema = RequestSchema()
        resp = self.service.post(self.base+str(id)+'/', json=json)
        return self.service.decode(schema, resp)
1339024
def commit(cls, client=None):
        
        if not client:
            client = cls._client
        rtn = client.write_points(cls._json_body_())
        cls._reset_()
        return rtn
439491
def _get_commit(self):
        
        obj = self._get_object()
        if obj.type == 'tag':
            obj = obj.object
        # END dereference tag

        if obj.type != Commit.type:
            raise TypeError("Symbolic Reference pointed to object %r, commit was required" % obj)
        # END handle type
        return obj
40039
def commit(self, commit):
		
		try:
			return self._commitData(self.repo.get_commit(commit))
		except (ValueError, KeyError, GithubException):
			raise KeyError("Commit %s not found" % commit)
1081129
def commit(self):
        ""
        if self._meta.path:
            with open(self._meta.path, 'wb') as fd:
                raw = deepcopy(self.raw)
                # LAZY INDEX PROCESSING
                # Save indexes only if not lazy
                lazy_indexes = self.lazy_indexes  # Keep this list safe
                if not self._meta.lazy_indexes:
                    # Remove indexes if needed
                    for idx_name in lazy_indexes:
                        del raw['indexes'][idx_name]
                    for index_name, values in raw['indexes'].items():
                        for value, keys in values.items():
                            raw['indexes'][index_name][value] = list(keys)
                # don't store indexes if not needed
                if not raw['indexes'] or self._meta.lazy_indexes:
                    del raw['indexes']
                try:
                    fd.write(six.u(self.serialize(raw)))
                except TypeError:
                    fd.write(six.b(self.serialize(raw)))
771460
def commit(self, commit):
		
		req_message = 'https://api.bitbucket.org/2.0/repositories/atlassian/aui/commit/' + commit
		response_data = self._bitbucketAPIRequest(req_message)
		try:
			return self._commitData(response_data)
		except (ValueError, KeyError):
			raise KeyError("Commit %s not found" % commit)
996950
def tryOrder(self, commit: Commit):
        
        canOrder, reason = self.canOrder(commit)
        if canOrder:
            self.logger.trace("{} returning request to node".format(self))
            self.doOrder(commit)
        else:
            self.logger.debug("{} cannot return request to node: {}".format(self, reason))
        return canOrder
200723
def canonical_request(self, method, path, content, timestamp):
        """"""
        request = collections.OrderedDict([
            ('Method', method.upper()),
            ('Hashed Path', path),
            ('X-Ops-Content-Hash', content),
            ('X-Ops-Timestamp', timestamp),
            ('X-Ops-UserId', self.user_id),
        ])
        return '\n'.join(['%s:%s' % (key, value)
                          for key, value in request.items()])
1157547
def commit(self):
        '''
        

        '''
        url = self.api_endpoints['send']
        payload = {
            'actions': self._bulk_query,
        }
        payload.update(self._payload)
        self._bulk_query = []

        return self._make_request(
            url,
            json.dumps(payload),
            headers={'content-type': 'application/json'},
        )
510038
def get_last_commit_to_master(repo_path="."):
    
    last_commit = None
    repo = None
    try:
        repo = Repo(repo_path)
    except (InvalidGitRepositoryError, NoSuchPathError):
        repo = None
    if repo:
        try:
            last_commit = repo.commits()[0]
        except AttributeError:
            # Optimised for version 0.3.2.RC1
            last_commit = repo.head.commit
    return str(last_commit)