summaryrefslogtreecommitdiffstats
path: root/services/gitdiff
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-08-13 20:49:30 +0800
committerGitHub <noreply@github.com>2023-08-13 20:49:30 +0800
commit82ea557dd37312af02b991069e2debb71721882b (patch)
tree70de5e1099d2cd43ef2861c00bced7dc67e45a7c /services/gitdiff
parentca74b074ea84dea1c37f7bd04b299de602e57e8c (diff)
downloadgitea-82ea557dd37312af02b991069e2debb71721882b.tar.gz
gitea-82ea557dd37312af02b991069e2debb71721882b.zip
Fix stderr usages (#26477)
Diffstat (limited to 'services/gitdiff')
-rw-r--r--services/gitdiff/gitdiff.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/services/gitdiff/gitdiff.go b/services/gitdiff/gitdiff.go
index 4cb2b1303d..4cc093e65d 100644
--- a/services/gitdiff/gitdiff.go
+++ b/services/gitdiff/gitdiff.go
@@ -13,7 +13,6 @@ import (
"html/template"
"io"
"net/url"
- "os"
"sort"
"strings"
"time"
@@ -1152,14 +1151,15 @@ func GetDiff(gitRepo *git.Repository, opts *DiffOptions, files ...string) (*Diff
}()
go func() {
+ stderr := &bytes.Buffer{}
cmdDiff.SetDescription(fmt.Sprintf("GetDiffRange [repo_path: %s]", repoPath))
if err := cmdDiff.Run(&git.RunOpts{
Timeout: time.Duration(setting.Git.Timeout.Default) * time.Second,
Dir: repoPath,
- Stderr: os.Stderr,
Stdout: writer,
+ Stderr: stderr,
}); err != nil {
- log.Error("error during RunWithContext: %w", err)
+ log.Error("error during GetDiff(git diff dir: %s): %v, stderr: %s", repoPath, err, stderr.String())
}
_ = writer.Close()