|
7 | 7 | "testing" |
8 | 8 |
|
9 | 9 | "github.com/cli/cli/context" |
| 10 | + "github.com/cli/cli/internal/run" |
10 | 11 | "github.com/cli/cli/test" |
11 | | - "github.com/cli/cli/utils" |
12 | 12 | ) |
13 | 13 |
|
14 | 14 | func TestPRCheckout_sameRepo(t *testing.T) { |
@@ -41,7 +41,7 @@ func TestPRCheckout_sameRepo(t *testing.T) { |
41 | 41 | `)) |
42 | 42 |
|
43 | 43 | ranCommands := [][]string{} |
44 | | - restoreCmd := utils.SetPrepareCmd(func(cmd *exec.Cmd) utils.Runnable { |
| 44 | + restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable { |
45 | 45 | switch strings.Join(cmd.Args, " ") { |
46 | 46 | case "git show-ref --verify --quiet refs/heads/feature": |
47 | 47 | return &errorStub{"exit status: 1"} |
@@ -93,7 +93,7 @@ func TestPRCheckout_urlArg(t *testing.T) { |
93 | 93 | `)) |
94 | 94 |
|
95 | 95 | ranCommands := [][]string{} |
96 | | - restoreCmd := utils.SetPrepareCmd(func(cmd *exec.Cmd) utils.Runnable { |
| 96 | + restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable { |
97 | 97 | switch strings.Join(cmd.Args, " ") { |
98 | 98 | case "git show-ref --verify --quiet refs/heads/feature": |
99 | 99 | return &errorStub{"exit status: 1"} |
@@ -142,7 +142,7 @@ func TestPRCheckout_branchArg(t *testing.T) { |
142 | 142 | `)) |
143 | 143 |
|
144 | 144 | ranCommands := [][]string{} |
145 | | - restoreCmd := utils.SetPrepareCmd(func(cmd *exec.Cmd) utils.Runnable { |
| 145 | + restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable { |
146 | 146 | switch strings.Join(cmd.Args, " ") { |
147 | 147 | case "git show-ref --verify --quiet refs/heads/feature": |
148 | 148 | return &errorStub{"exit status: 1"} |
@@ -191,7 +191,7 @@ func TestPRCheckout_existingBranch(t *testing.T) { |
191 | 191 | `)) |
192 | 192 |
|
193 | 193 | ranCommands := [][]string{} |
194 | | - restoreCmd := utils.SetPrepareCmd(func(cmd *exec.Cmd) utils.Runnable { |
| 194 | + restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable { |
195 | 195 | switch strings.Join(cmd.Args, " ") { |
196 | 196 | case "git show-ref --verify --quiet refs/heads/feature": |
197 | 197 | return &test.OutputStub{} |
@@ -243,7 +243,7 @@ func TestPRCheckout_differentRepo_remoteExists(t *testing.T) { |
243 | 243 | `)) |
244 | 244 |
|
245 | 245 | ranCommands := [][]string{} |
246 | | - restoreCmd := utils.SetPrepareCmd(func(cmd *exec.Cmd) utils.Runnable { |
| 246 | + restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable { |
247 | 247 | switch strings.Join(cmd.Args, " ") { |
248 | 248 | case "git show-ref --verify --quiet refs/heads/feature": |
249 | 249 | return &errorStub{"exit status: 1"} |
@@ -295,7 +295,7 @@ func TestPRCheckout_differentRepo(t *testing.T) { |
295 | 295 | `)) |
296 | 296 |
|
297 | 297 | ranCommands := [][]string{} |
298 | | - restoreCmd := utils.SetPrepareCmd(func(cmd *exec.Cmd) utils.Runnable { |
| 298 | + restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable { |
299 | 299 | switch strings.Join(cmd.Args, " ") { |
300 | 300 | case "git config branch.feature.merge": |
301 | 301 | return &errorStub{"exit status 1"} |
@@ -347,7 +347,7 @@ func TestPRCheckout_differentRepo_existingBranch(t *testing.T) { |
347 | 347 | `)) |
348 | 348 |
|
349 | 349 | ranCommands := [][]string{} |
350 | | - restoreCmd := utils.SetPrepareCmd(func(cmd *exec.Cmd) utils.Runnable { |
| 350 | + restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable { |
351 | 351 | switch strings.Join(cmd.Args, " ") { |
352 | 352 | case "git config branch.feature.merge": |
353 | 353 | return &test.OutputStub{[]byte("refs/heads/feature\n")} |
@@ -397,7 +397,7 @@ func TestPRCheckout_differentRepo_currentBranch(t *testing.T) { |
397 | 397 | `)) |
398 | 398 |
|
399 | 399 | ranCommands := [][]string{} |
400 | | - restoreCmd := utils.SetPrepareCmd(func(cmd *exec.Cmd) utils.Runnable { |
| 400 | + restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable { |
401 | 401 | switch strings.Join(cmd.Args, " ") { |
402 | 402 | case "git config branch.feature.merge": |
403 | 403 | return &test.OutputStub{[]byte("refs/heads/feature\n")} |
@@ -447,7 +447,7 @@ func TestPRCheckout_maintainerCanModify(t *testing.T) { |
447 | 447 | `)) |
448 | 448 |
|
449 | 449 | ranCommands := [][]string{} |
450 | | - restoreCmd := utils.SetPrepareCmd(func(cmd *exec.Cmd) utils.Runnable { |
| 450 | + restoreCmd := run.SetPrepareCmd(func(cmd *exec.Cmd) run.Runnable { |
451 | 451 | switch strings.Join(cmd.Args, " ") { |
452 | 452 | case "git config branch.feature.merge": |
453 | 453 | return &errorStub{"exit status 1"} |
|
0 commit comments