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

Function TestStatusNothing

status_test.go:65–91  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

63}
64
65func TestStatusNothing(t *testing.T) {
66 t.Parallel()
67 repo := createTestRepo(t)
68 defer cleanupTestRepo(t, repo)
69
70 seedTestRepo(t, repo)
71
72 opts := &StatusOptions{
73 Show: StatusShowIndexAndWorkdir,
74 Flags: StatusOptIncludeUntracked | StatusOptRenamesHeadToIndex | StatusOptSortCaseSensitively,
75 }
76
77 statusList, err := repo.StatusList(opts)
78 checkFatal(t, err)
79
80 entryCount, err := statusList.EntryCount()
81 checkFatal(t, err)
82
83 if entryCount != 0 {
84 t.Fatal("expected no statuses in empty repo")
85 }
86
87 _, err = statusList.ByIndex(0)
88 if err == nil {
89 t.Error("expected error getting status by index")
90 }
91}

Callers

nothing calls this directly

Calls 8

createTestRepoFunction · 0.85
cleanupTestRepoFunction · 0.85
seedTestRepoFunction · 0.85
checkFatalFunction · 0.85
StatusListMethod · 0.80
ByIndexMethod · 0.80
ErrorMethod · 0.80
EntryCountMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…