MCPcopy
hub / github.com/github/git-sizer / UpdateRef

Method UpdateRef

internal/testutils/repoutils.go:156–167  ·  view source on GitHub ↗

UpdateRef updates the reference named `refname` to the value `oid`.

(t *testing.T, refname string, oid git.OID)

Source from the content-addressed store, hash-verified

154
155// UpdateRef updates the reference named `refname` to the value `oid`.
156func (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

Callers 2

newGitBombFunction · 0.80

Calls 3

GitCommandMethod · 0.95
RunMethod · 0.80
StringMethod · 0.45

Tested by 1

newGitBombFunction · 0.64