mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Fix stderr usages (#26477)
This commit is contained in:
		@@ -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()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user