diff options
Diffstat (limited to 'qa/qa/factory/repository/push.rb')
-rw-r--r-- | qa/qa/factory/repository/push.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/qa/qa/factory/repository/push.rb b/qa/qa/factory/repository/push.rb index 4f97e65b091..5b7ebf6c41f 100644 --- a/qa/qa/factory/repository/push.rb +++ b/qa/qa/factory/repository/push.rb @@ -5,7 +5,8 @@ module QA module Repository class Push < Factory::Base attr_accessor :file_name, :file_content, :commit_message, - :branch_name, :new_branch, :output, :repository_uri + :branch_name, :new_branch, :output, :repository_uri, + :user attr_writer :remote_branch @@ -31,9 +32,20 @@ module QA def fabricate! Git::Repository.perform do |repository| repository.uri = repository_uri + repository.use_default_credentials + username = 'GitLab QA' + email = 'root@gitlab.com' + + if user + repository.username = user.username + repository.password = user.password + username = user.name + email = user.email + end + repository.clone - repository.configure_identity('GitLab QA', 'root@gitlab.com') + repository.configure_identity(username, email) if new_branch repository.checkout_new_branch(branch_name) |