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

Function TestStatusFile

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

Source from the content-addressed store, hash-verified

7)
8
9func TestStatusFile(t *testing.T) {
10 t.Parallel()
11 repo := createTestRepo(t)
12 defer cleanupTestRepo(t, repo)
13
14 state := repo.State()
15 if state != RepositoryStateNone {
16 t.Fatal("Incorrect repository state: ", state)
17 }
18
19 err := ioutil.WriteFile(path.Join(path.Dir(repo.Workdir()), "hello.txt"), []byte("Hello, World"), 0644)
20 checkFatal(t, err)
21
22 status, err := repo.StatusFile("hello.txt")
23 checkFatal(t, err)
24
25 if status != StatusWtNew {
26 t.Fatal("Incorrect status flags: ", status)
27 }
28}
29
30func TestStatusList(t *testing.T) {
31 t.Parallel()

Callers

nothing calls this directly

Calls 6

createTestRepoFunction · 0.85
cleanupTestRepoFunction · 0.85
checkFatalFunction · 0.85
StateMethod · 0.80
WorkdirMethod · 0.80
StatusFileMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…