(c *C)
| 1660 | } |
| 1661 | |
| 1662 | func (s *WorktreeSuite) TestIgnored(c *C) { |
| 1663 | fs := memfs.New() |
| 1664 | w := &Worktree{ |
| 1665 | r: s.Repository, |
| 1666 | Filesystem: fs, |
| 1667 | } |
| 1668 | |
| 1669 | w.Excludes = make([]gitignore.Pattern, 0) |
| 1670 | w.Excludes = append(w.Excludes, gitignore.ParsePattern("foo", nil)) |
| 1671 | |
| 1672 | err := w.Checkout(&CheckoutOptions{Force: true}) |
| 1673 | c.Assert(err, IsNil) |
| 1674 | |
| 1675 | idx, err := w.r.Storer.Index() |
| 1676 | c.Assert(err, IsNil) |
| 1677 | c.Assert(idx.Entries, HasLen, 9) |
| 1678 | |
| 1679 | err = util.WriteFile(w.Filesystem, "foo", []byte("FOO"), 0755) |
| 1680 | c.Assert(err, IsNil) |
| 1681 | |
| 1682 | status, err := w.Status() |
| 1683 | c.Assert(err, IsNil) |
| 1684 | c.Assert(status, HasLen, 0) |
| 1685 | |
| 1686 | file := status.File("foo") |
| 1687 | c.Assert(file.Staging, Equals, Untracked) |
| 1688 | c.Assert(file.Worktree, Equals, Untracked) |
| 1689 | } |
| 1690 | |
| 1691 | func (s *WorktreeSuite) TestExcludedNoGitignore(c *C) { |
| 1692 | f := fixtures.ByTag("empty").One() |
nothing calls this directly
no test coverage detected