File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,7 +33,6 @@ func Dir() (string, error) {
3333
3434func WorkdirName () (string , error ) {
3535 toplevelCmd := exec .Command ("git" , "rev-parse" , "--show-toplevel" )
36- toplevelCmd .Stderr = nil
3736 output , err := utils .PrepareCmd (toplevelCmd ).Output ()
3837 dir := firstLine (output )
3938 if dir == "" {
Original file line number Diff line number Diff line change @@ -38,6 +38,9 @@ func (c cmdWithStderr) Output() ([]byte, error) {
3838 if os .Getenv ("DEBUG" ) != "" {
3939 fmt .Fprintf (os .Stderr , "%v\n " , c .Cmd .Args )
4040 }
41+ if c .Cmd .Stderr != nil {
42+ return c .Cmd .Output ()
43+ }
4144 errStream := & bytes.Buffer {}
4245 c .Cmd .Stderr = errStream
4346 out , err := c .Cmd .Output ()
@@ -51,6 +54,9 @@ func (c cmdWithStderr) Run() error {
5154 if os .Getenv ("DEBUG" ) != "" {
5255 fmt .Fprintf (os .Stderr , "%v\n " , c .Cmd .Args )
5356 }
57+ if c .Cmd .Stderr != nil {
58+ return c .Cmd .Run ()
59+ }
5460 errStream := & bytes.Buffer {}
5561 c .Cmd .Stderr = errStream
5662 err := c .Cmd .Run ()
You can’t perform that action at this time.
0 commit comments