History

Remove `git.Command.Run` and `git.Command.RunInDir*` (#19280)

Follows #19266, #8553, Close #18553, now there are only three `Run..(&RunOpts{})` functions. * before: `stdout, err := RunInDir(path)` * now: `stdout, _, err := RunStdString(&git.RunOpts{Dir:path})`

wxiaoguang committed 4 years ago

Commit 124b0721 parent 3a7364578 files · +594 −672Browse files

Showing the changes to services/gitdiff/gitdiff.go (1 of 78 files). Show all

Unified · Split

services/gitdiff/gitdiff.go+1−1
@@ -1378,7 +1378,7 @@ func GetDiff(gitRepo *git.Repository, opts *DiffOptions, files ...string) (*Diff · 1377 unmodified lines
1378 go func(ctx context.Context, diffArgs []string, repoPath string, writer *io.PipeWriter) {1378 go func(ctx context.Context, diffArgs []string, repoPath string, writer *io.PipeWriter) {
1379 cmd := git.NewCommand(ctx, diffArgs...)1379 cmd := git.NewCommand(ctx, diffArgs...)
1380 cmd.SetDescription(fmt.Sprintf("GetDiffRange [repo_path: %s]", repoPath))1380 cmd.SetDescription(fmt.Sprintf("GetDiffRange [repo_path: %s]", repoPath))
1381 if err := cmd.RunWithContext(&git.RunContext{1381 if err := cmd.Run(&git.RunOpts{
1382 Timeout: time.Duration(setting.Git.Timeout.Default) * time.Second,1382 Timeout: time.Duration(setting.Git.Timeout.Default) * time.Second,
1383 Dir: repoPath,1383 Dir: repoPath,
1384 Stderr: os.Stderr,1384 Stderr: os.Stderr,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t