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

Commitf51cd52

Browse files
Manuel LeonhardtJohnVillalovos
Manuel Leonhardt
authored andcommitted
feat(files): add support for more optional flags
GitLab's Repository Files API supports additional flags that weren'timplemented before. Notably, the "start_branch" flag is particularlyuseful, as previously one had to use the "project-branch" commandalongside "project-file" to add a file on a separate branch.[1]https://docs.gitlab.com/ee/api/repository_files.html
1 parent541a7e3 commitf51cd52

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

‎gitlab/v4/objects/files.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,24 @@ class ProjectFileManager(CreateMixin, UpdateMixin, DeleteMixin, RESTManager):
102102
_optional_get_attrs:Tuple[str, ...]= ()
103103
_create_attrs=RequiredOptional(
104104
required=("file_path","branch","content","commit_message"),
105-
optional=("encoding","author_email","author_name"),
105+
optional=(
106+
"encoding",
107+
"author_email",
108+
"author_name",
109+
"execute_filemode",
110+
"start_branch",
111+
),
106112
)
107113
_update_attrs=RequiredOptional(
108114
required=("file_path","branch","content","commit_message"),
109-
optional=("encoding","author_email","author_name"),
115+
optional=(
116+
"encoding",
117+
"author_email",
118+
"author_name",
119+
"execute_filemode",
120+
"start_branch",
121+
"last_commit_id",
122+
),
110123
)
111124

112125
@cli.register_custom_action(
@@ -164,7 +177,13 @@ def head(
164177
@cli.register_custom_action(
165178
cls_names="ProjectFileManager",
166179
required=("file_path","branch","content","commit_message"),
167-
optional=("encoding","author_email","author_name"),
180+
optional=(
181+
"encoding",
182+
"author_email",
183+
"author_name",
184+
"execute_filemode",
185+
"start_branch",
186+
),
168187
)
169188
@exc.on_http_error(exc.GitlabCreateError)
170189
defcreate(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp