GitCommand creates an `*exec.Cmd` for running `git` in `repo` with the specified arguments.
(t *testing.T, args ...string)
| 141 | // GitCommand creates an `*exec.Cmd` for running `git` in `repo` with |
| 142 | // the specified arguments. |
| 143 | func (repo *TestRepo) GitCommand(t *testing.T, args ...string) *exec.Cmd { |
| 144 | t.Helper() |
| 145 | |
| 146 | gitArgs := []string{"-C", repo.Path} |
| 147 | gitArgs = append(gitArgs, args...) |
| 148 | |
| 149 | //nolint:gosec // The args all come from the test code. |
| 150 | cmd := exec.Command("git", gitArgs...) |
| 151 | cmd.Env = CleanGitEnv() |
| 152 | return cmd |
| 153 | } |
| 154 | |
| 155 | // UpdateRef updates the reference named `refname` to the value `oid`. |
| 156 | func (repo *TestRepo) UpdateRef(t *testing.T, refname string, oid git.OID) { |