From 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 17 Dec 2020 11:59:07 +0000 Subject: Add latest changes from gitlab-org/gitlab@13-7-stable-ee --- qa/qa/resource/repository/push.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'qa/qa/resource/repository/push.rb') diff --git a/qa/qa/resource/repository/push.rb b/qa/qa/resource/repository/push.rb index 5266f8b9bea..f5b6040d927 100644 --- a/qa/qa/resource/repository/push.rb +++ b/qa/qa/resource/repository/push.rb @@ -17,7 +17,6 @@ module QA @file_name = "file-#{SecureRandom.hex(8)}.txt" @file_content = '# This is test file' @commit_message = "This is a test commit" - @branch_name = 'master' @new_branch = true @repository_http_uri = "" @ssh_key = nil @@ -78,6 +77,8 @@ module QA @output += repository.clone repository.configure_identity(name, email) + @branch_name ||= default_branch(repository) + @output += repository.checkout(branch_name, new_branch: new_branch) if @tag_name @@ -105,6 +106,10 @@ module QA private + def default_branch(repository) + repository.remote_branches.last || Runtime::Env.default_branch + end + def commit_to(repository) @gpg_key_id.nil? ? repository.commit(@commit_message) : repository.commit_with_gpg(@commit_message) end -- cgit v1.2.1