MCPcopy
hub / github.com/go-git/go-git / TestStatusUntracked

Method TestStatusUntracked

worktree_test.go:1550–1568  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

1548}
1549
1550func (s *WorktreeSuite) TestStatusUntracked(c *C) {
1551 fs := memfs.New()
1552 w := &Worktree{
1553 r: s.Repository,
1554 Filesystem: fs,
1555 }
1556
1557 err := w.Checkout(&CheckoutOptions{Force: true})
1558 c.Assert(err, IsNil)
1559
1560 f, err := w.Filesystem.Create("foo")
1561 c.Assert(err, IsNil)
1562 c.Assert(f.Close(), IsNil)
1563
1564 status, err := w.Status()
1565 c.Assert(err, IsNil)
1566 c.Assert(status.File("foo").Staging, Equals, Untracked)
1567 c.Assert(status.File("foo").Worktree, Equals, Untracked)
1568}
1569
1570func (s *WorktreeSuite) TestStatusDeleted(c *C) {
1571 fs := s.TemporalFilesystem(c)

Callers

nothing calls this directly

Calls 5

CheckoutMethod · 0.95
StatusMethod · 0.95
CloseMethod · 0.65
CreateMethod · 0.45
FileMethod · 0.45

Tested by

no test coverage detected