(cc) link to official api reference

pull/20/head
Langenfeld 2023-01-12 16:01:06 +01:00
rodzic 4808018f2a
commit 5407ab2468
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -520,14 +520,14 @@ class Repository(ApiObject):
# TODO: make sure this instance is either updated or discarded
def get_git_content(self: str = None, commit: "Commit" = None) -> List["Content"]:
"""https://git.sopranium.de/api/swagger#/repository/repoGetContentsList"""
"""https://try.gitea.io/api/swagger#/repository/repoGetContentsList"""
url = f"/repos/{self.owner.username}/{self.name}/contents"
data = {"ref": commit.sha} if commit else {}
result = [Content.parse_response(self.gitea, f) for f in self.gitea.requests_get(url, data)]
return result
def get_file_content(self, content: "Content", commit: "Commit" = None) -> Union[str, List["Content"]]:
"""https://git.sopranium.de/api/swagger#/repository/repoGetContents"""
"""https://try.gitea.io/api/swagger#/repository/repoGetContents"""
url = f"/repos/{self.owner.username}/{self.name}/contents/{content.path}"
data = {"ref": commit.sha} if commit else {}
if content.type == Content.FILE: