mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-02 11:51:10 +00:00
Handle a path of / in Repository.get_contents() (#1070)
The path requested in Repository.get_contents() is appended to the URL, so the root path should be requested with the empty string. If path is '/', set it to the empty string. Copy the replay data from the original test, since it is identical. Drive-by renaming the test to include the missing 's'. Closes #1059
This commit is contained in:
committed by
Wan Liuyang
parent
3d43e9c0e6
commit
102c820806
@@ -1478,6 +1478,9 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
"""
|
||||
assert isinstance(path, (str, unicode)), path
|
||||
assert ref is github.GithubObject.NotSet or isinstance(ref, (str, unicode)), ref
|
||||
# Path of '/' should be the empty string.
|
||||
if path == '/':
|
||||
path = ''
|
||||
url_parameters = dict()
|
||||
if ref is not github.GithubObject.NotSet:
|
||||
url_parameters["ref"] = ref
|
||||
|
||||
Reference in New Issue
Block a user