| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Looks like conflict with the pre-existing path variable.
Sorry, something went wrong.
|
@JohnVillalovos for later: we could potentially also prefix these internal python-gitlab variables in the mixins and custom methods to always avoid clashes with GitLab API attributes. So this would be _path here for example. Not sure how ugly that would get. @orf sometimes our variables happen to overlap with upstream API attributes hence the suggestion. diff --git a/gitlab/v4/objects/repositories.py b/gitlab/v4/objects/repositories.py
index 8f99e5d..b8dbdd8 100644
--- a/gitlab/v4/objects/repositories.py
+++ b/gitlab/v4/objects/repositories.py
@@ -229,16 +229,16 @@ class RepositoryMixin(_RestObjectBase):
Returns:
The binary data of the archive
"""
- path = f"/projects/{self.encoded_id}/repository/archive"
+ url_path = f"/projects/{self.encoded_id}/repository/archive"
if format:
- path += "." + format
+ url_path += "." + format
query_data = {}
if sha:
query_data["sha"] = sha
if path is not None:
query_data["path"] = path
result = self.manager.gitlab.http_get(
- path, query_data=query_data, raw=True, streamed=streamed, **kwargs
+ url_path, query_data=query_data, raw=True, streamed=streamed, **kwargs
)
if TYPE_CHECKING:
assert isinstance(result, requests.Response) |
Sorry, something went wrong.
|
Thank you both! I've applied your suggestions 🙏 |
Sorry, something went wrong.
|
I guess we can get this one in, I hope you don't mind @JohnVillalovos ;) @orf thanks again! I think I recognized your username from the loguru saga, fun popcorn material. :) |
Sorry, something went wrong.
Thanks for reviewing it @nejch ! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
https://docs.gitlab.com/ee/api/repositories.html#get-file-archive
The archive endpoint supports a path argument. This change adds support for it.