@@ -201,6 +201,7 @@ def repository_archive(
201201action :Optional [Callable [...,Any ]]= None ,
202202chunk_size :int = 1024 ,
203203format :Optional [str ]= None ,
204+ path :Optional [str ]= None ,
204205* ,
205206iterator :bool = False ,
206207** kwargs :Any ,
@@ -218,6 +219,7 @@ def repository_archive(
218219 data
219220 chunk_size: Size of each chunk
220221 format: file format (tar.gz by default)
222+ path: The subpath of the repository to download (all files by default)
221223 **kwargs: Extra options to send to the server (e.g. sudo)
222224
223225 Raises:
@@ -227,14 +229,16 @@ def repository_archive(
227229 Returns:
228230 The binary data of the archive
229231 """
230- path = f"/projects/{ self .encoded_id } /repository/archive"
232+ url_path = f"/projects/{ self .encoded_id } /repository/archive"
231233if format :
232- path += "." + format
234+ url_path += "." + format
233235query_data = {}
234236if sha :
235237query_data ["sha" ]= sha
238+ if path is not None :
239+ query_data ["path" ]= path
236240result = self .manager .gitlab .http_get (
237- path ,query_data = query_data ,raw = True ,streamed = streamed ,** kwargs
241+ url_path ,query_data = query_data ,raw = True ,streamed = streamed ,** kwargs
238242 )
239243if TYPE_CHECKING :
240244assert isinstance (result ,requests .Response )