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

Method TestStatusModified

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

Source from the content-addressed store, hash-verified

1477}
1478
1479func (s *WorktreeSuite) TestStatusModified(c *C) {
1480 fs := s.TemporalFilesystem(c)
1481
1482 w := &Worktree{
1483 r: s.Repository,
1484 Filesystem: fs,
1485 }
1486
1487 err := w.Checkout(&CheckoutOptions{})
1488 c.Assert(err, IsNil)
1489
1490 f, err := fs.Create(".gitignore")
1491 c.Assert(err, IsNil)
1492 _, err = f.Write([]byte("foo"))
1493 c.Assert(err, IsNil)
1494 err = f.Close()
1495 c.Assert(err, IsNil)
1496
1497 status, err := w.Status()
1498 c.Assert(err, IsNil)
1499 c.Assert(status.IsClean(), Equals, false)
1500 c.Assert(status.File(".gitignore").Worktree, Equals, Modified)
1501}
1502
1503func (s *WorktreeSuite) TestStatusIgnored(c *C) {
1504 fs := memfs.New()

Callers

nothing calls this directly

Calls 8

CheckoutMethod · 0.95
StatusMethod · 0.95
CloseMethod · 0.65
TemporalFilesystemMethod · 0.45
CreateMethod · 0.45
WriteMethod · 0.45
IsCleanMethod · 0.45
FileMethod · 0.45

Tested by

no test coverage detected