def latest_commit(self): commit = DataFile(self.dir + '.git\\LatestCommit') if not commit['commit']: commit['commit'] = {'sha': '', 'etag': ''} etag = commit['commit']['etag'] sha = commit['commit']['sha'] resp = self.get('git/refs/heads/' + self.branch, etag) if resp.hasdata(): if not resp.is_json(): raise TypeError('Response not in JSON') sha = resp.data['object']['sha'] commit.merge('commit', {'etag': resp.etag, 'sha': sha}) return sha
def latest_commit(self): commit=DataFile(self.dir+'.git\\LatestCommit') if not commit['commit']: commit['commit']={'sha':'','etag':''} etag=commit['commit']['etag'] sha=commit['commit']['sha'] resp=self.get('git/refs/heads/'+self.branch,etag) if resp.hasdata(): if not resp.is_json(): raise TypeError('Response not in JSON') sha=resp.data['object']['sha'] commit.merge('commit',{'etag':resp.etag,'sha':sha}) return sha