Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support downloading archive subpaths#2199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nejch merged 1 commit intopython-gitlab:mainfromorf:patch-1
Jul 29, 2022
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletionsgitlab/v4/objects/repositories.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -201,6 +201,7 @@ def repository_archive(
action: Optional[Callable[..., Any]] = None,
chunk_size: int = 1024,
format: Optional[str] = None,
path: Optional[str] = None,
*,
iterator: bool = False,
**kwargs: Any,
Expand All@@ -218,6 +219,7 @@ def repository_archive(
data
chunk_size: Size of each chunk
format: file format (tar.gz by default)
path: The subpath of the repository to download (all files by default)
**kwargs: Extra options to send to the server (e.g. sudo)

Raises:
Expand All@@ -227,14 +229,16 @@ def repository_archive(
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)
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp