summaryrefslogtreecommitdiff
path: root/lib/gitlab/popen.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-01-24 21:05:01 +0800
committerLin Jen-Shin <godfat@godfat.org>2018-01-26 19:42:48 +0800
commita2618310aea7d58e52d2d29ec4871e27717eb0f0 (patch)
tree63c943c0cd428e82955574f578ef55b5c166f1e6 /lib/gitlab/popen.rb
parent0bf918f05e827b380107d88f4592d1ceedd632f9 (diff)
downloadgitlab-ce-a2618310aea7d58e52d2d29ec4871e27717eb0f0.tar.gz
Use Process::Status rather than an integer
However keep backward compatibility
Diffstat (limited to 'lib/gitlab/popen.rb')
-rw-r--r--lib/gitlab/popen.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/popen.rb b/lib/gitlab/popen.rb
index 05526a9ac94..b9832a724c4 100644
--- a/lib/gitlab/popen.rb
+++ b/lib/gitlab/popen.rb
@@ -11,7 +11,7 @@ module Gitlab
def popen(cmd, path = nil, vars = {}, &block)
result = popen_with_detail(cmd, path, vars, &block)
- [result.stdout << result.stderr, result.status]
+ [result.stdout << result.stderr, result.status&.exitstatus]
end
# Returns Result
@@ -30,7 +30,7 @@ module Gitlab
cmd_stdout = ''
cmd_stderr = ''
- cmd_status = 0
+ cmd_status = nil
start = Time.now
Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr|
@@ -39,7 +39,7 @@ module Gitlab
cmd_stdout = stdout.read
cmd_stderr = stderr.read
- cmd_status = wait_thr.value.exitstatus
+ cmd_status = wait_thr.value
end
Result.new(cmd, cmd_stdout, cmd_stderr, cmd_status, Time.now - start)