diff --git a/github/Repository.py b/github/Repository.py index 07272179..65c17a6c 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -1265,7 +1265,8 @@ class Repository(github.GithubObject.CompletableGithubObject): input=put_parameters ) - return github.ContentFile.ContentFile(self._requester, headers, data, completed=True) + return {'content': github.ContentFile.ContentFile(self._requester, headers['content'], data, completed=True), + 'commit': github.Commit.Commit(self._requester, headers, data['commit'], completed=True)} def update_file(self, path, message, content, sha, branch=github.GithubObject.NotSet, @@ -1317,7 +1318,8 @@ class Repository(github.GithubObject.CompletableGithubObject): input=put_parameters ) - return github.ContentFile.ContentFile(self._requester, headers, data, completed=True) + return {'commit': github.Commit.Commit(self._requester, headers, data['commit'], completed=True), + 'content': github.ContentFile.ContentFile(self._requester, headers, data['content'], completed=True)} def delete_file(self, path, message, sha, branch=github.GithubObject.NotSet): @@ -1327,7 +1329,9 @@ class Repository(github.GithubObject.CompletableGithubObject): :param message: string, Required. The commit message. :param sha: string, Required. The blob SHA of the file being replaced. :param branch: string. The branch name. Default: the repository’s default branch (usually master) - :rtype: None + :rtype: { + 'content': :class:`null `:, + 'commit': :class:`Commit `} """ assert isinstance(path, (str, unicode)), \ 'path must be str/unicode object' @@ -1349,6 +1353,9 @@ class Repository(github.GithubObject.CompletableGithubObject): input=url_parameters ) + return {'commit': github.Commit.Commit(self._requester, headers, data['commit'], completed=True), + 'content': github.GithubObject.NotSet} + def get_dir_contents(self, path, ref=github.GithubObject.NotSet): """ :calls: `GET /repos/:owner/:repo/contents/:path `_