diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2017-05-05 11:34:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-05 11:34:50 +0200 |
commit | ced875aec7bef9113e1c37b1b811a59e17dbd138 (patch) | |
tree | 3cf652b8cfa94e011d4d7b5addfd13945870cda8 /worktree_test.go | |
parent | e80cdbabb92a1ec35ffad536f52d3ff04b548fd1 (diff) | |
parent | 3713157d189a109bdccdb055200defb17297b6de (diff) | |
download | go-git-ced875aec7bef9113e1c37b1b811a59e17dbd138.tar.gz |
Merge pull request #375 from mcuadros/commit
worktree: Commit method implementation
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{ |