Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb4e1d56

Browse files
ebishopnejch
authored andcommitted
fix(files): add optional ref parameter for cli project-file raw (#3032)
The ef parameter was removed in python-gitlab v4.8.0. This will add ef back as an optional parameter for the project-file raw cli command.
1 parente4673d8 commitb4e1d56

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

‎gitlab/v4/objects/files.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ def delete( # type: ignore[override]
277277
@cli.register_custom_action(
278278
cls_names="ProjectFileManager",
279279
required=("file_path",),
280+
optional=("ref",),
280281
)
281282
@exc.on_http_error(exc.GitlabGetError)
282283
defraw(
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
deftest_project_file_raw(gitlab_cli,project,project_file):
2+
cmd= ["project-file","raw","--project-id",project.id,"--file-path","README"]
3+
ret=gitlab_cli(cmd)
4+
assertret.success
5+
assert"Initial content"inret.stdout
6+
7+
8+
deftest_project_file_raw_ref(gitlab_cli,project,project_file):
9+
cmd= [
10+
"project-file",
11+
"raw",
12+
"--project-id",
13+
project.id,
14+
"--file-path",
15+
"README",
16+
"--ref",
17+
"main",
18+
]
19+
ret=gitlab_cli(cmd)
20+
assertret.success
21+
assert"Initial content"inret.stdout

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp