GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: file save start_branch as a body attribute · python-gitlab/python-gitlab@1001d93

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • gitlab/v4/objects
    • files.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎gitlab/v4/objects/files.py‎

Copy file name to clipboardExpand all lines: gitlab/v4/objects/files.py
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class ProjectFile(SaveMixin, ObjectDeleteMixin, RESTObject):
2929
file_path: str
3030
manager: ProjectFileManager
3131
content: str # since the `decode()` method uses `self.content`
32+
start_branch: str | None = None
3233

3334
def decode(self) -> bytes:
3435
"""Returns the decoded content of the file.
@@ -41,7 +42,11 @@ def decode(self) -> bytes:
4142
# NOTE(jlvillal): Signature doesn't match SaveMixin.save() so ignore
4243
# type error
4344
def save( # type: ignore[override]
44-
self, branch: str, commit_message: str, **kwargs: Any
45+
self,
46+
branch: str,
47+
commit_message: str,
48+
start_branch: str | None = None,
49+
**kwargs: Any,
4550
) -> None:
4651
"""Save the changes made to the file to the server.
4752
@@ -50,6 +55,7 @@ def save( # type: ignore[override]
5055
Args:
5156
branch: Branch in which the file will be updated
5257
commit_message: Message to send with the commit
58+
start_branch: Name of the branch to start the new branch from
5359
**kwargs: Extra options to send to the server (e.g. sudo)
5460
5561
Raises:
@@ -58,6 +64,7 @@ def save( # type: ignore[override]
5864
"""
5965
self.branch = branch
6066
self.commit_message = commit_message
67+
self.start_branch = start_branch
6168
self.file_path = utils.EncodedId(self.file_path)
6269
super().save(**kwargs)
6370

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.