Skip to content

Commit 19ac575

Browse files
authored
Limit stdout tracelog to actual stdout (#16258)
Related #16243 Signed-off-by: Andrew Thornton <[email protected]>
1 parent e3c6268 commit 19ac575

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/git/command.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,11 @@ func (c *Command) RunInDirTimeoutEnv(env []string, timeout time.Duration, dir st
199199
return nil, ConcatenateError(err, stderr.String())
200200
}
201201
if stdout.Len() > 0 && log.IsTrace() {
202-
log.Trace("Stdout:\n %s", stdout.Bytes()[:1024])
202+
tracelen := stdout.Len()
203+
if tracelen > 1024 {
204+
tracelen = 1024
205+
}
206+
log.Trace("Stdout:\n %s", stdout.Bytes()[:tracelen])
203207
}
204208
return stdout.Bytes(), nil
205209
}

0 commit comments

Comments
 (0)