# File lib/grit/git.rb, line 246 def sh(command) ret, err = '', '' Open3.popen3(command) do |_, stdout, stderr| Timeout.timeout(self.class.git_timeout) do while tmp = stdout.read(1024) ret += tmp if (@bytes_read += tmp.size) > self.class.git_max_size bytes = @bytes_read @bytes_read = 0 raise GitTimeout.new(command, bytes) end end end while tmp = stderr.read(1024) err += tmp end end [ret, err] rescue Timeout::Error, Grit::Git::GitTimeout bytes = @bytes_read @bytes_read = 0 raise GitTimeout.new(command, bytes) end