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

Function TestCreateRepoAndStage

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

Source from the content-addressed store, hash-verified

9)
10
11func TestCreateRepoAndStage(t *testing.T) {
12 t.Parallel()
13 repo := createTestRepo(t)
14 defer cleanupTestRepo(t, repo)
15
16 idx, err := repo.Index()
17 checkFatal(t, err)
18 err = idx.AddByPath("README")
19 checkFatal(t, err)
20 treeId, err := idx.WriteTree()
21 checkFatal(t, err)
22
23 if treeId.String() != "b7119b11e8ef7a1a5a34d3ac87f5b075228ac81e" {
24 t.Fatalf("%v", treeId.String())
25 }
26}
27
28func TestIndexReadTree(t *testing.T) {
29 t.Parallel()

Callers

nothing calls this directly

Calls 7

createTestRepoFunction · 0.85
cleanupTestRepoFunction · 0.85
checkFatalFunction · 0.85
AddByPathMethod · 0.80
WriteTreeMethod · 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…