UpdateRef updates the reference named `refname` to the value `oid`.
(t *testing.T, refname string, oid git.OID)
| 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) { |
| 157 | t.Helper() |
| 158 | |
| 159 | var cmd *exec.Cmd |
| 160 | |
| 161 | if oid == git.NullOID { |
| 162 | cmd = repo.GitCommand(t, "update-ref", "-d", refname) |
| 163 | } else { |
| 164 | cmd = repo.GitCommand(t, "update-ref", refname, oid.String()) |
| 165 | } |
| 166 | require.NoError(t, cmd.Run()) |
| 167 | } |
| 168 | |
| 169 | // CreateObject creates a new Git object, of the specified type, in |
| 170 | // the repository at `repoPath`. `writer` is a function that generates |