class Git::CommandLine::Capturing

Executes a git command and captures both stdout and stderr in memory

{Git::CommandLine::Capturing} is the buffering strategy: it calls ‘ProcessExecuter.run_with_capture`, which reads all subprocess output into `String` objects before returning. Use this class (via {Git::ExecutionContext#command_capturing}) for the vast majority of git subcommands whose output fits comfortably in memory.

{Git::CommandLine::Streaming} is the complementary strategy for commands (such as ‘cat-file -p <blob>`) whose stdout may be too large to buffer.

@example

capturing = Git::CommandLine::Capturing.new(
  {}, '/usr/bin/git', %w[--git-dir /repo/.git], Logger.new($stdout)
)
result = capturing.run('log', '--oneline', '-5')
result.stdout   # => "abc1234 Initial commit\n..."
result.stderr   # => ""

@see Git::ExecutionContext#command_capturing

@see Git::CommandLine::Streaming

@api private