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

Function TestRemoteLsFiltering

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

Source from the content-addressed store, hash-verified

125}
126
127func TestRemoteLsFiltering(t *testing.T) {
128 t.Parallel()
129 repo := createTestRepo(t)
130 defer cleanupTestRepo(t, repo)
131
132 remote, err := repo.Remotes.Create("origin", "https://github.com/libgit2/TestGitRepository")
133 checkFatal(t, err)
134 defer remote.Free()
135
136 err = remote.ConnectFetch(nil, nil, nil)
137 checkFatal(t, err)
138
139 heads, err := remote.Ls("master")
140 checkFatal(t, err)
141
142 if len(heads) != 1 {
143 t.Fatalf("Expected one head for master but I got %d", len(heads))
144 }
145
146 if heads[0].Id == nil {
147 t.Fatalf("Expected head to have an Id, but it's nil")
148 }
149
150 if heads[0].Name == "" {
151 t.Fatalf("Expected head to have a name, but it's empty")
152 }
153}
154
155func TestRemotePruneRefs(t *testing.T) {
156 t.Parallel()

Callers

nothing calls this directly

Calls 7

createTestRepoFunction · 0.85
cleanupTestRepoFunction · 0.85
checkFatalFunction · 0.85
ConnectFetchMethod · 0.80
LsMethod · 0.80
FreeMethod · 0.65
CreateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…