mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-02 03:41:08 +00:00
fix update/delete/create content return value invalid issue
This commit is contained in:
+10
-3
@@ -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 <github.GithubObject.NotSet>`:,
|
||||
'commit': :class:`Commit <github.Commit.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 <http://developer.github.com/v3/repos/contents>`_
|
||||
|
||||
Reference in New Issue
Block a user