@@ -228,13 +228,14 @@ def delete( # type: ignore
228228self .gitlab .http_delete (path ,query_data = data ,** kwargs )
229229
230230@cli .register_custom_action (
231- cls_names = "ProjectFileManager" ,required = ("file_path" ,"ref" )
231+ cls_names = "ProjectFileManager" ,
232+ required = ("file_path" ,),
232233 )
233234@exc .on_http_error (exc .GitlabGetError )
234235def raw (
235236self ,
236237file_path :str ,
237- ref :str ,
238+ ref :Optional [ str ] = None ,
238239streamed :bool = False ,
239240action :Optional [Callable [...,Any ]]= None ,
240241chunk_size :int = 1024 ,
@@ -245,16 +246,16 @@ def raw(
245246"""Return the content of a file for a commit.
246247
247248 Args:
248- ref: ID of the commit
249249 file_path: Path of the file to return
250+ ref: ID of the commit
250251 streamed: If True the data will be processed by chunks of
251252 `chunk_size` and each chunk is passed to `action` for
252253 treatment
253- iterator: If True directly return the underlying response
254- iterator
255- action: Callable responsible of dealing with chunk of
254+ action: Callable responsible for dealing with each chunk of
256255 data
257256 chunk_size: Size of each chunk
257+ iterator: If True directly return the underlying response
258+ iterator
258259 **kwargs: Extra options to send to the server (e.g. sudo)
259260
260261 Raises:
@@ -266,7 +267,10 @@ def raw(
266267 """
267268file_path = utils .EncodedId (file_path )
268269path = f"{ self .path } /{ file_path } /raw"
269- query_data = {"ref" :ref }
270+ if ref :
271+ query_data = {"ref" :ref }
272+ else :
273+ query_data = None
270274result = self .gitlab .http_get (
271275path ,query_data = query_data ,streamed = streamed ,raw = True ,** kwargs
272276 )