MCPcopy Create free account
hub / github.com/go-git/go-git / TestStatusModified

Method TestStatusModified

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

Source from the content-addressed store, hash-verified

1275}
1276
1277func (s *WorktreeSuite) TestStatusModified(c *C) {
1278 fs, clean := s.TemporalFilesystem()
1279 defer clean()
1280
1281 w := &Worktree{
1282 r: s.Repository,
1283 Filesystem: fs,
1284 }
1285
1286 err := w.Checkout(&CheckoutOptions{})
1287 c.Assert(err, IsNil)
1288
1289 f, err := fs.Create(".gitignore")
1290 c.Assert(err, IsNil)
1291 _, err = f.Write([]byte("foo"))
1292 c.Assert(err, IsNil)
1293 err = f.Close()
1294 c.Assert(err, IsNil)
1295
1296 status, err := w.Status()
1297 c.Assert(err, IsNil)
1298 c.Assert(status.IsClean(), Equals, false)
1299 c.Assert(status.File(".gitignore").Worktree, Equals, Modified)
1300}
1301
1302func (s *WorktreeSuite) TestStatusIgnored(c *C) {
1303 fs := memfs.New()

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected