forked from forgejo/forgejo
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})`
This commit is contained in:
parent
3a73645502
commit
124b072f0b
78 changed files with 594 additions and 672 deletions
|
@ -19,7 +19,7 @@ func TestRunWithContextNoTimeout(t *testing.T) {
|
|||
// 'git --version' does not block so it must be finished before the timeout triggered.
|
||||
cmd := NewCommand(context.Background(), "--version")
|
||||
for i := 0; i < maxLoops; i++ {
|
||||
if err := cmd.RunWithContext(&RunContext{}); err != nil {
|
||||
if err := cmd.Run(&RunOpts{}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ func TestRunWithContextTimeout(t *testing.T) {
|
|||
// 'git hash-object --stdin' blocks on stdin so we can have the timeout triggered.
|
||||
cmd := NewCommand(context.Background(), "hash-object", "--stdin")
|
||||
for i := 0; i < maxLoops; i++ {
|
||||
if err := cmd.RunWithContext(&RunContext{Timeout: 1 * time.Millisecond}); err != nil {
|
||||
if err := cmd.Run(&RunOpts{Timeout: 1 * time.Millisecond}); err != nil {
|
||||
if err != context.DeadlineExceeded {
|
||||
t.Fatalf("Testing %d/%d: %v", i, maxLoops, err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue