summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-06-26 13:47:56 +0100
committerGitHub <noreply@github.com>2021-06-26 13:47:56 +0100
commit19ac575d572af655ab691f829d0b4de38a1f10be (patch)
treeda786cd703d0a17430d93d86c35e800ba8209870 /modules
parente3c626834b34fae7728ee7869ed73ee4d1b26a26 (diff)
downloadgitea-19ac575d572af655ab691f829d0b4de38a1f10be.tar.gz
gitea-19ac575d572af655ab691f829d0b4de38a1f10be.zip
Limit stdout tracelog to actual stdout (#16258)
Related #16243 Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'modules')
-rw-r--r--modules/git/command.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/git/command.go b/modules/git/command.go
index 127e95ecfb..d83c42fdc2 100644
--- a/modules/git/command.go
+++ b/modules/git/command.go
@@ -199,7 +199,11 @@ func (c *Command) RunInDirTimeoutEnv(env []string, timeout time.Duration, dir st
return nil, ConcatenateError(err, stderr.String())
}
if stdout.Len() > 0 && log.IsTrace() {
- log.Trace("Stdout:\n %s", stdout.Bytes()[:1024])
+ tracelen := stdout.Len()
+ if tracelen > 1024 {
+ tracelen = 1024
+ }
+ log.Trace("Stdout:\n %s", stdout.Bytes()[:tracelen])
}
return stdout.Bytes(), nil
}