aboutsummaryrefslogtreecommitdiffstats
path: root/worktree_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-05-05 11:34:50 +0200
committerGitHub <noreply@github.com>2017-05-05 11:34:50 +0200
commitced875aec7bef9113e1c37b1b811a59e17dbd138 (patch)
tree3cf652b8cfa94e011d4d7b5addfd13945870cda8 /worktree_test.go
parente80cdbabb92a1ec35ffad536f52d3ff04b548fd1 (diff)
parent3713157d189a109bdccdb055200defb17297b6de (diff)
downloadgo-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.go18
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{