summaryrefslogtreecommitdiff
path: root/qa/qa/resource/repository/commit.rb
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/resource/repository/commit.rb')
-rw-r--r--qa/qa/resource/repository/commit.rb15
1 files changed, 12 insertions, 3 deletions
diff --git a/qa/qa/resource/repository/commit.rb b/qa/qa/resource/repository/commit.rb
index d15210aa736..f5dba164de6 100644
--- a/qa/qa/resource/repository/commit.rb
+++ b/qa/qa/resource/repository/commit.rb
@@ -9,7 +9,8 @@ module QA
:branch,
:commit_message,
:file_path,
- :sha
+ :sha,
+ :start_branch
attribute :short_id
@@ -80,12 +81,12 @@ module QA
def api_post_body
{
- branch: @branch || "master",
+ branch: @branch || project.default_branch,
author_email: @author_email || Runtime::User.default_email,
author_name: @author_name || Runtime::User.username,
commit_message: commit_message,
actions: actions
- }
+ }.merge(new_branch)
end
def actions
@@ -104,6 +105,14 @@ module QA
raise ArgumentError, "Please provide an array of hashes e.g.: [{file_path: 'file1', content: 'foo'}]"
end
end
+
+ def new_branch
+ return {} unless start_branch
+
+ {
+ start_branch: start_branch
+ }
+ end
end
end
end