Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions gitlab/v4/objects/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ def delete( # type: ignore[override]
@cli.register_custom_action(
cls_names="ProjectFileManager",
required=("file_path",),
optional=("ref",),
)
@exc.on_http_error(exc.GitlabGetError)
def raw(
Expand Down
21 changes: 21 additions & 0 deletions tests/functional/cli/test_cli_files.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
def test_project_file_raw(gitlab_cli, project, project_file):
cmd = ["project-file", "raw", "--project-id", project.id, "--file-path", "README"]
ret = gitlab_cli(cmd)
assert ret.success
assert "Initial content" in ret.stdout


def test_project_file_raw_ref(gitlab_cli, project, project_file):
cmd = [
"project-file",
"raw",
"--project-id",
project.id,
"--file-path",
"README",
"--ref",
"main",
]
ret = gitlab_cli(cmd)
assert ret.success
assert "Initial content" in ret.stdout
Loading