summaryrefslogtreecommitdiff
path: root/qa/qa/git/repository.rb
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/git/repository.rb')
-rw-r--r--qa/qa/git/repository.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/qa/qa/git/repository.rb b/qa/qa/git/repository.rb
index b3150e8f3fa..1367671e3ca 100644
--- a/qa/qa/git/repository.rb
+++ b/qa/qa/git/repository.rb
@@ -1,19 +1,21 @@
require 'cgi'
require 'uri'
+require 'open3'
module QA
module Git
class Repository
include Scenario::Actable
+ attr_reader :push_error
+
def self.perform(*args)
Dir.mktmpdir do |dir|
Dir.chdir(dir) { super }
end
end
- def location=(address)
- @location = address
+ def uri=(address)
@uri = URI(address)
end
@@ -40,6 +42,10 @@ module QA
`git checkout "#{branch_name}"`
end
+ def checkout_new_branch(branch_name)
+ `git checkout -b "#{branch_name}"`
+ end
+
def shallow_clone
clone('--depth 1')
end
@@ -65,7 +71,8 @@ module QA
end
def push_changes(branch = 'master')
- `git push #{@uri.to_s} #{branch} #{suppress_output}`
+ # capture3 returns stdout, stderr and status.
+ _, @push_error, _ = Open3.capture3("git push #{@uri} #{branch} #{suppress_output}")
end
def commits