diff options
Diffstat (limited to 'worktree_test.go')
-rw-r--r-- | worktree_test.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/worktree_test.go b/worktree_test.go index f06a1f9..68760f2 100644 --- a/worktree_test.go +++ b/worktree_test.go @@ -9,6 +9,7 @@ import ( "gopkg.in/src-d/go-git.v4/plumbing/filemode" "gopkg.in/src-d/go-git.v4/plumbing/format/index" "gopkg.in/src-d/go-git.v4/plumbing/object" + "gopkg.in/src-d/go-git.v4/storage/memory" "github.com/src-d/go-git-fixtures" . "gopkg.in/check.v1" @@ -286,10 +287,27 @@ func (s *WorktreeSuite) TestStatus(c *C) { status, err := w.Status() c.Assert(err, IsNil) + c.Assert(status.IsClean(), Equals, false) c.Assert(status, HasLen, 9) } +func (s *WorktreeSuite) TestStatusEmpty(c *C) { + fs := memfs.New() + storage := memory.NewStorage() + + r, err := Init(storage, fs) + c.Assert(err, IsNil) + + w, err := r.Worktree() + c.Assert(err, IsNil) + + status, err := w.Status() + c.Assert(err, IsNil) + c.Assert(status.IsClean(), Equals, true) + c.Assert(status, NotNil) +} + func (s *WorktreeSuite) TestReset(c *C) { fs := memfs.New() w := &Worktree{ |