MCPcopy Create free account
hub / github.com/libgit2/git2go / TestRemotePruneRefs

Function TestRemotePruneRefs

remote_test.go:155–178  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

153}
154
155func TestRemotePruneRefs(t *testing.T) {
156 t.Parallel()
157 repo := createTestRepo(t)
158 defer cleanupTestRepo(t, repo)
159
160 config, err := repo.Config()
161 checkFatal(t, err)
162 defer config.Free()
163
164 err = config.SetBool("remote.origin.prune", true)
165 checkFatal(t, err)
166
167 remote, err := repo.Remotes.Create("origin", "https://github.com/libgit2/TestGitRepository")
168 checkFatal(t, err)
169 defer remote.Free()
170
171 remote, err = repo.Remotes.Lookup("origin")
172 checkFatal(t, err)
173 defer remote.Free()
174
175 if !remote.PruneRefs() {
176 t.Fatal("Expected remote to be configured to prune references")
177 }
178}
179
180func TestRemotePrune(t *testing.T) {
181 t.Parallel()

Callers

nothing calls this directly

Calls 9

createTestRepoFunction · 0.85
cleanupTestRepoFunction · 0.85
checkFatalFunction · 0.85
ConfigMethod · 0.80
SetBoolMethod · 0.80
PruneRefsMethod · 0.80
FreeMethod · 0.65
CreateMethod · 0.45
LookupMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…