@@ -56,7 +56,7 @@ def save( # type: ignore
5656 """
5757 self .branch = branch
5858 self .commit_message = commit_message
59- self .file_path = utils ._url_encode (self .file_path )
59+ self .file_path = utils .EncodedId (self .file_path )
6060 super (ProjectFile , self ).save (** kwargs )
6161
6262 @exc .on_http_error (exc .GitlabDeleteError )
@@ -144,7 +144,7 @@ def create(
144144 assert data is not None
145145 self ._check_missing_create_attrs (data )
146146 new_data = data .copy ()
147- file_path = utils ._url_encode (new_data .pop ("file_path" ))
147+ file_path = utils .EncodedId (new_data .pop ("file_path" ))
148148 path = f"{ self .path } /{ file_path } "
149149 server_data = self .gitlab .http_post (path , post_data = new_data , ** kwargs )
150150 if TYPE_CHECKING :
@@ -173,7 +173,7 @@ def update( # type: ignore
173173 """
174174 new_data = new_data or {}
175175 data = new_data .copy ()
176- file_path = utils ._url_encode (file_path )
176+ file_path = utils .EncodedId (file_path )
177177 data ["file_path" ] = file_path
178178 path = f"{ self .path } /{ file_path } "
179179 self ._check_missing_update_attrs (data )
@@ -203,7 +203,7 @@ def delete( # type: ignore
203203 GitlabAuthenticationError: If authentication is not correct
204204 GitlabDeleteError: If the server cannot perform the request
205205 """
206- file_path = utils ._url_encode (file_path )
206+ file_path = utils .EncodedId (file_path )
207207 path = f"{ self .path } /{ file_path } "
208208 data = {"branch" : branch , "commit_message" : commit_message }
209209 self .gitlab .http_delete (path , query_data = data , ** kwargs )
@@ -239,7 +239,7 @@ def raw(
239239 Returns:
240240 The file content
241241 """
242- file_path = utils ._url_encode (file_path )
242+ file_path = utils .EncodedId (file_path )
243243 path = f"{ self .path } /{ file_path } /raw"
244244 query_data = {"ref" : ref }
245245 result = self .gitlab .http_get (
@@ -266,7 +266,7 @@ def blame(self, file_path: str, ref: str, **kwargs: Any) -> List[Dict[str, Any]]
266266 Returns:
267267 A list of commits/lines matching the file
268268 """
269- file_path = utils ._url_encode (file_path )
269+ file_path = utils .EncodedId (file_path )
270270 path = f"{ self .path } /{ file_path } /blame"
271271 query_data = {"ref" : ref }
272272 result = self .gitlab .http_list (path , query_data , ** kwargs )
0 commit comments