MCPcopy Create free account
hub / github.com/git-bug/git-bug / TestGoGitRepo_Indexes

Function TestGoGitRepo_Indexes

repository/gogit_test.go:65–85  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

63}
64
65func TestGoGitRepo_Indexes(t *testing.T) {
66 repo := CreateGoGitTestRepo(t, false)
67 plainRoot := goGitRepoDir(t, repo)
68
69 // Can create indices
70 indexA, err := repo.GetIndex("a")
71 require.NoError(t, err)
72 require.NotZero(t, indexA)
73 require.FileExists(t, filepath.Join(plainRoot, ".git", namespace, "indexes", "a", "index_meta.json"))
74 require.FileExists(t, filepath.Join(plainRoot, ".git", namespace, "indexes", "a", "store"))
75
76 indexB, err := repo.GetIndex("b")
77 require.NoError(t, err)
78 require.NotZero(t, indexB)
79 require.DirExists(t, filepath.Join(plainRoot, ".git", namespace, "indexes", "b"))
80
81 // Can get an existing index
82 indexA, err = repo.GetIndex("a")
83 require.NoError(t, err)
84 require.NotZero(t, indexA)
85}
86
87func TestGoGit_DetectsSubmodules(t *testing.T) {
88 repo := CreateGoGitTestRepo(t, false)

Callers

nothing calls this directly

Calls 3

CreateGoGitTestRepoFunction · 0.85
goGitRepoDirFunction · 0.85
GetIndexMethod · 0.65

Tested by

no test coverage detected