8000 [v4] Fix the CLI for project files · python-gitlab/python-gitlab@cda2d59 · GitHub
[go: up one dir, main page]

Skip to content

Commit cda2d59

Browse files
author
Gauvain Pocentek
committed
[v4] Fix the CLI for project files
1 parent f00562c commit cda2d59

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

gitlab/v4/objects.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,6 +1374,7 @@ class ProjectFileManager(GetMixin, CreateMixin, UpdateMixin, DeleteMixin,
13741374
_update_attrs = (('file_path', 'branch', 'content', 'commit_message'),
13751375
('encoding', 'author_email', 'author_name'))
13761376

1377+
@cli.register_custom_action('ProjectFileManager', ('file_path', 'ref'))
13771378
def get(self, file_path, ref, **kwargs):
13781379
"""Retrieve a single file.
13791380
@@ -1392,6 +1393,10 @@ def get(self, file_path, ref, **kwargs):
13921393
file_path = file_path.replace('/', '%2F')
13931394
return GetMixin.get(self, file_path, ref=ref, **kwargs)
13941395

1396+
@cli.register_custom_action('ProjectFileManager',
1397+
('file_path', 'branch', 'content',
1398+
'commit_message'),
1399+
('encoding', 'author_email', 'author_name'))
13951400
@exc.on_http_error(exc.GitlabCreateError)
13961401
def create(self, data, **kwargs):
13971402
"""Create a new object.
@@ -1416,6 +1421,8 @@ def create(self, data, **kwargs):
14161421
server_data = self.gitlab.http_post(path, post_data=data, **kwargs)
14171422
return self._obj_cls(self, server_data)
14181423

1424+
@cli.register_custom_action('ProjectFileManager', ('file_path', 'branch',
1425+
'commit_message'))
14191426
@exc.on_http_error(exc.GitlabDeleteError)
14201427
def delete(self, file_path, branch, commit_message, **kwargs):
14211428
"""Delete a file on the server.

0 commit comments

Comments
 (0)
0