1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-10-31 19:42:16 +01:00

Skip binary files in gitea_api.PullRequest.get_patch()

This commit is contained in:
2025-08-18 15:22:06 +02:00
parent 86ef6f4797
commit cc18f9c668

View File

@@ -409,7 +409,11 @@ class PullRequest:
:param repo: Name of the repo.
:param number: Number of the pull request in the repo.
"""
url = conn.makeurl("repos", owner, repo, "pulls", f"{number}.patch")
q = {
"binary": 0,
}
# XXX: .patch suffix doesn't work with binary=0
url = conn.makeurl("repos", owner, repo, "pulls", f"{number}.diff", query=q)
response = conn.request("GET", url)
return response.data