@@ -29,6 +29,7 @@ class ProjectFile(SaveMixin, ObjectDeleteMixin, RESTObject):
|
29 | 29 | file_path: str |
30 | 30 | manager: ProjectFileManager |
31 | 31 | content: str # since the `decode()` method uses `self.content` |
| 32 | +start_branch: str | None = None |
32 | 33 | |
33 | 34 | def decode(self) -> bytes: |
34 | 35 | """Returns the decoded content of the file. |
@@ -41,7 +42,11 @@ def decode(self) -> bytes:
|
41 | 42 | # NOTE(jlvillal): Signature doesn't match SaveMixin.save() so ignore |
42 | 43 | # type error |
43 | 44 | 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, |
45 | 50 | ) -> None: |
46 | 51 | """Save the changes made to the file to the server. |
47 | 52 | |
@@ -50,6 +55,7 @@ def save( # type: ignore[override]
|
50 | 55 | Args: |
51 | 56 | branch: Branch in which the file will be updated |
52 | 57 | commit_message: Message to send with the commit |
| 58 | + start_branch: Name of the branch to start the new branch from |
53 | 59 | **kwargs: Extra options to send to the server (e.g. sudo) |
54 | 60 | |
55 | 61 | Raises: |
@@ -58,6 +64,7 @@ def save( # type: ignore[override]
|
58 | 64 | """ |
59 | 65 | self.branch = branch |
60 | 66 | self.commit_message = commit_message |
| 67 | +self.start_branch = start_branch |
61 | 68 | self.file_path = utils.EncodedId(self.file_path) |
62 | 69 | super().save(**kwargs) |
63 | 70 | |
|