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

Function TestIndexAddAllNoCallback

index_test.go:192–212  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

190}
191
192func TestIndexAddAllNoCallback(t *testing.T) {
193 t.Parallel()
194 repo := createTestRepo(t)
195 defer cleanupTestRepo(t, repo)
196
197 err := ioutil.WriteFile(repo.Workdir()+"/README", []byte("foo\n"), 0644)
198 checkFatal(t, err)
199
200 idx, err := repo.Index()
201 checkFatal(t, err)
202
203 err = idx.AddAll([]string{}, IndexAddDefault, nil)
204 checkFatal(t, err)
205
206 treeId, err := idx.WriteTreeTo(repo)
207 checkFatal(t, err)
208
209 if treeId.String() != "b7119b11e8ef7a1a5a34d3ac87f5b075228ac81e" {
210 t.Fatalf("%v", treeId.String())
211 }
212}
213
214func TestIndexAddAllCallback(t *testing.T) {
215 t.Parallel()

Callers

nothing calls this directly

Calls 8

createTestRepoFunction · 0.85
cleanupTestRepoFunction · 0.85
checkFatalFunction · 0.85
WorkdirMethod · 0.80
AddAllMethod · 0.80
WriteTreeToMethod · 0.80
IndexMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…