(c *C)
| 1460 | } |
| 1461 | |
| 1462 | func (s *WorktreeSuite) TestIgnored(c *C) { |
| 1463 | fs := memfs.New() |
| 1464 | w := &Worktree{ |
| 1465 | r: s.Repository, |
| 1466 | Filesystem: fs, |
| 1467 | } |
| 1468 | |
| 1469 | w.Excludes = make([]gitignore.Pattern, 0) |
| 1470 | w.Excludes = append(w.Excludes, gitignore.ParsePattern("foo", nil)) |
| 1471 | |
| 1472 | err := w.Checkout(&CheckoutOptions{Force: true}) |
| 1473 | c.Assert(err, IsNil) |
| 1474 | |
| 1475 | idx, err := w.r.Storer.Index() |
| 1476 | c.Assert(err, IsNil) |
| 1477 | c.Assert(idx.Entries, HasLen, 9) |
| 1478 | |
| 1479 | err = util.WriteFile(w.Filesystem, "foo", []byte("FOO"), 0755) |
| 1480 | c.Assert(err, IsNil) |
| 1481 | |
| 1482 | status, err := w.Status() |
| 1483 | c.Assert(err, IsNil) |
| 1484 | c.Assert(status, HasLen, 0) |
| 1485 | |
| 1486 | file := status.File("foo") |
| 1487 | c.Assert(file.Staging, Equals, Untracked) |
| 1488 | c.Assert(file.Worktree, Equals, Untracked) |
| 1489 | } |
| 1490 | |
| 1491 | func (s *WorktreeSuite) TestExcludedNoGitignore(c *C) { |
| 1492 | f := fixtures.ByTag("empty").One() |
nothing calls this directly
no test coverage detected