From 0f29a53e1789603db64b5b9ccaf65042f0e7eae0 Mon Sep 17 00:00:00 2001 From: Jannis Gebauer Date: Fri, 29 Jul 2016 09:54:31 +0200 Subject: [PATCH] fixed file API return values The returned objects were not correctly populated, leaving us with empty objects. This is now fixed. --- github/Repository.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/github/Repository.py b/github/Repository.py index ce77647c..19b1fcc3 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -1285,8 +1285,8 @@ class Repository(github.GithubObject.CompletableGithubObject): input=put_parameters ) - return {'content': github.ContentFile.ContentFile(self._requester, headers, data, completed=True), - 'commit': github.Commit.Commit(self._requester, headers, data, completed=True)} + return {'content': github.ContentFile.ContentFile(self._requester, headers, data["content"], completed=False), + 'commit': github.Commit.Commit(self._requester, headers, data["commit"], completed=True)} def update_file(self, path, message, content, sha, branch=github.GithubObject.NotSet, @@ -1342,8 +1342,8 @@ class Repository(github.GithubObject.CompletableGithubObject): input=put_parameters ) - return {'commit': github.Commit.Commit(self._requester, headers, data, completed=True), - 'content': 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=False)} def delete_file(self, path, message, sha, branch=github.GithubObject.NotSet): @@ -1377,7 +1377,7 @@ class Repository(github.GithubObject.CompletableGithubObject): input=url_parameters ) - return {'commit': github.Commit.Commit(self._requester, headers, data, completed=True), + 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):