Skip to content
This repository was archived by the owner on Jun 12, 2021. It is now read-only.

Commit 0692d43

Browse files
committed
Merge branch 'master' of github.com:gitlabhq/grit
2 parents 75d9298 + 3018e16 commit 0692d43

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/grit/git.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,18 @@ class CommandFailed < StandardError
2323
# The integer exit status.
2424
attr_reader :exitstatus
2525

26+
# Everything output on the command's stdout as a String.
27+
attr_reader :out
28+
2629
# Everything output on the command's stderr as a String.
2730
attr_reader :err
2831

29-
def initialize(command, exitstatus=nil, err='')
32+
def initialize(command, exitstatus=nil, err='', out='')
3033
if exitstatus
3134
@command = command
3235
@exitstatus = exitstatus
3336
@err = err
37+
@out = out
3438
message = "Command failed [#{exitstatus}]: #{command}"
3539
message << "\n\n" << err unless err.nil? || err.empty?
3640
super message
@@ -344,7 +348,7 @@ def native(cmd, options = {}, *args, &block)
344348

345349
status = process.status
346350
if raise_errors && !status.success?
347-
raise CommandFailed.new(argv.join(' '), status.exitstatus, process.err)
351+
raise CommandFailed.new(argv.join(' '), status.exitstatus, process.err, process.out)
348352
elsif process_info
349353
[status.exitstatus, process.out, process.err]
350354
else

0 commit comments

Comments
 (0)