@@ -14,18 +14,20 @@ module Git
14
14
class FailedError < Git ::GitExecuteError
15
15
# Create a FailedError object
16
16
#
17
+ # Since this gem redirects stderr to stdout, the stdout of the process is used.
18
+ #
17
19
# @example
18
20
# `exit 1` # set $? appropriately for this example
19
- # result = Git::CommandLineResult.new(%w[git status], $?, '', "failed" )
21
+ # result = Git::CommandLineResult.new(%w[git status], $?, 'stdout ', 'stderr' )
20
22
# error = Git::FailedError.new(result)
21
23
# error.message #=>
22
- # "[\"git\", \"status\"]\nstatus: pid 89784 exit 1\nstderr : \"failed \""
24
+ # "[\"git\", \"status\"]\nstatus: pid 89784 exit 1\noutput : \"stdout \""
23
25
#
24
26
# @param result [Git::CommandLineResult] the result of the git command including
25
27
# the git command, status, stdout, and stderr
26
28
#
27
29
def initialize ( result )
28
- super ( "#{ result . git_cmd } \n status: #{ result . status } \n stderr : #{ result . stderr . inspect } " )
30
+ super ( "#{ result . git_cmd } \n status: #{ result . status } \n output : #{ result . stdout . inspect } " )
29
31
@result = result
30
32
end
31
33
@@ -35,14 +37,14 @@ def initialize(result)
35
37
#
36
38
# @example
37
39
# `exit 1` # set $? appropriately for this example
38
- # result = Git::CommandLineResult.new(%w[git status], $?, '', "failed" )
40
+ # result = Git::CommandLineResult.new(%w[git status], $?, 'stdout ', 'stderr' )
39
41
# error = Git::FailedError.new(result)
40
42
# error.result #=>
41
43
# #<Git::CommandLineResult:0x00000001046bd488
42
44
# @git_cmd=["git", "status"],
43
45
# @status=#<Process::Status: pid 89784 exit 1>,
44
- # @stderr="failed ",
45
- # @stdout="">
46
+ # @stderr="stderr ",
47
+ # @stdout="stdout ">
46
48
#
47
49
# @return [Git::CommandLineResult]
48
50
#
0 commit comments