ctxAt returns a context after switching the process into the repo dir, so the git helpers (which shell out in the cwd) operate on this repo.
(t *testing.T)
| 97 | // ctxAt returns a context after switching the process into the repo dir, so the |
| 98 | // git helpers (which shell out in the cwd) operate on this repo. |
| 99 | func (r *gitRepo) ctxAt(t *testing.T) context.Context { |
| 100 | t.Helper() |
| 101 | cwd, err := os.Getwd() |
| 102 | require.NoError(t, err) |
| 103 | require.NoError(t, os.Chdir(r.dir)) |
| 104 | t.Cleanup(func() { _ = os.Chdir(cwd) }) |
| 105 | return t.Context() |
| 106 | } |
| 107 | |
| 108 | func (r *gitRepo) run(t *testing.T, args ...string) { |
| 109 | t.Helper() |
no outgoing calls
no test coverage detected