diff options
author | Robert Speicher <robert@gitlab.com> | 2017-12-15 19:56:15 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-12-15 19:56:15 +0000 |
commit | b540b987648ae6e24bbbc01a7773b2e3209a47b0 (patch) | |
tree | 904ace3d5524eef227976910e136f98925e62371 /lib/gitlab/git | |
parent | 95f5a525b5a729725d6b559101026b8f39c9c39d (diff) | |
parent | 02994fbe7715ef4539f720b6d395eeb9a3d71f14 (diff) | |
download | gitlab-ce-b540b987648ae6e24bbbc01a7773b2e3209a47b0.tar.gz |
Merge branch 'no-ivar-in-modules' into 'master'
Add cop to make sure we don't use ivar in a module
See merge request gitlab-org/gitlab-ce!12800
Diffstat (limited to 'lib/gitlab/git')
-rw-r--r-- | lib/gitlab/git/popen.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/gitlab/git/popen.rb b/lib/gitlab/git/popen.rb index d41fe78daa1..1ccca13ce2f 100644 --- a/lib/gitlab/git/popen.rb +++ b/lib/gitlab/git/popen.rb @@ -16,8 +16,8 @@ module Gitlab vars['PWD'] = path options = { chdir: path } - @cmd_output = "" - @cmd_status = 0 + cmd_output = "" + cmd_status = 0 Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr| yield(stdin) if block_given? stdin.close @@ -25,14 +25,14 @@ module Gitlab if lazy_block return lazy_block.call(stdout.lazy) else - @cmd_output << stdout.read + cmd_output << stdout.read end - @cmd_output << stderr.read - @cmd_status = wait_thr.value.exitstatus + cmd_output << stderr.read + cmd_status = wait_thr.value.exitstatus end - [@cmd_output, @cmd_status] + [cmd_output, cmd_status] end def popen_with_timeout(cmd, timeout, path, vars = {}) |