MCPcopy Create free account
hub / github.com/cwarden/git-add--interactive / TestNewRepository

Function TestNewRepository

internal/git/repository_test.go:8–26  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

6)
7
8func TestNewRepository(t *testing.T) {
9 wd, err := os.Getwd()
10 if err != nil {
11 t.Fatal(err)
12 }
13
14 repo, err := NewRepository(wd)
15 if err != nil {
16 t.Skip("Not in a git repository, skipping test")
17 }
18
19 if repo.GitDir() == "" {
20 t.Error("GitDir() should not be empty")
21 }
22
23 if repo.WorkTree() == "" {
24 t.Error("WorkTree() should not be empty")
25 }
26}
27
28func TestGetConfigBool(t *testing.T) {
29 wd, err := os.Getwd()

Callers

nothing calls this directly

Calls 3

GitDirMethod · 0.95
WorkTreeMethod · 0.95
NewRepositoryFunction · 0.85

Tested by

no test coverage detected