From b7516e425e1353fe509237b5b25a6f5c55ba6c01 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Tue, 19 Aug 2025 12:56:55 +0200 Subject: [PATCH] [12.1] Add support for "force" when creating commit (#836) * add support for "force" when creating commit * fix type Co-authored-by: Jeffrey Cafferata --------- Co-authored-by: Jeffrey Cafferata --- src/Api/Repositories.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Api/Repositories.php b/src/Api/Repositories.php index eded16b9..b3c1f890 100644 --- a/src/Api/Repositories.php +++ b/src/Api/Repositories.php @@ -191,6 +191,7 @@ public function commitRefs(int|string $project_id, string $sha, array $parameter * @var string $branch Name of the branch to commit into. To create a new branch, also provide start_branch. * @var string $commit_message commit message * @var string $start_branch name of the branch to start the new commit from + * @var bool $force true if the new changes should override existing ones * @var array $actions { * @var string $action he action to perform, create, delete, move, update * @var string $file_path full path to the file @@ -212,6 +213,8 @@ public function createCommit(int|string $project_id, array $parameters = []): mi ->setRequired('commit_message') ; $resolver->setDefined('start_branch'); + $resolver->setDefined('force') + ->setAllowedTypes('force', 'bool'); $resolver->setDefined('actions') ->setRequired('actions') ->setAllowedTypes('actions', 'array')