Showing the changes to services/gitdiff/gitdiff.go (1 of 3 files). Show all
Unified · Split
| @@ -13,7 +13,6 @@ import ( · 12 unmodified lines | |||
| 13 | "html/template" | 13 | "html/template" |
| 14 | "io" | 14 | "io" |
| 15 | "net/url" | 15 | "net/url" |
| 16 | "os" | ||
| 17 | "sort" | 16 | "sort" |
| 18 | "strings" | 17 | "strings" |
| 19 | "time" | 18 | "time" |
| @@ -1152,14 +1151,15 @@ func GetDiff(gitRepo *git.Repository, opts *DiffOptions, files ...string) (*Diff · 1132 unmodified lines | |||
| 1152 | }() | 1151 | }() |
| 1153 | 1152 | ||
| 1154 | go func() { | 1153 | go func() { |
| 1154 | stderr := &bytes.Buffer{} | ||
| 1155 | cmdDiff.SetDescription(fmt.Sprintf("GetDiffRange [repo_path: %s]", repoPath)) | 1155 | cmdDiff.SetDescription(fmt.Sprintf("GetDiffRange [repo_path: %s]", repoPath)) |
| 1156 | if err := cmdDiff.Run(&git.RunOpts{ | 1156 | if err := cmdDiff.Run(&git.RunOpts{ |
| 1157 | Timeout: time.Duration(setting.Git.Timeout.Default) * time.Second, | 1157 | Timeout: time.Duration(setting.Git.Timeout.Default) * time.Second, |
| 1158 | Dir: repoPath, | 1158 | Dir: repoPath, |
| 1159 | Stderr: os.Stderr, | ||
| 1160 | Stdout: writer, | 1159 | Stdout: writer, |
| 1160 | Stderr: stderr, | ||
| 1161 | }); err != nil { | 1161 | }); err != nil { |
| 1162 | log.Error("error during RunWithContext: %w", err) | 1162 | log.Error("error during GetDiff(git diff dir: %s): %v, stderr: %s", repoPath, err, stderr.String()) |
| 1163 | } | 1163 | } |
| 1164 | 1164 | ||
| 1165 | _ = writer.Close() | 1165 | _ = writer.Close() |