Suppress git output when running QA as a non-default user
This commit is contained in:
parent
d6fd2f5b0f
commit
8bf5203bdc
|
@ -33,7 +33,7 @@ module QA
|
|||
end
|
||||
|
||||
def clone(opts = '')
|
||||
`git clone #{opts} #{@uri.to_s} ./`
|
||||
`git clone #{opts} #{@uri.to_s} ./ #{suppress_output}`
|
||||
end
|
||||
|
||||
def shallow_clone
|
||||
|
@ -61,12 +61,22 @@ module QA
|
|||
end
|
||||
|
||||
def push_changes(branch = 'master')
|
||||
`git push #{@uri.to_s} #{branch}`
|
||||
`git push #{@uri.to_s} #{branch} #{suppress_output}`
|
||||
end
|
||||
|
||||
def commits
|
||||
`git log --oneline`.split("\n")
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def suppress_output
|
||||
# If we're running as the default user, it's probably a temporary
|
||||
# instance and output can be useful for debugging
|
||||
return if @username == Runtime::User.default_name
|
||||
|
||||
"&> #{File::NULL}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue