aboutsummaryrefslogtreecommitdiffstats
path: root/worktree_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-05-03 23:37:21 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2017-05-03 23:37:21 +0200
commit2e092f909f643ef455d84dfa59282f0f0adf3c7a (patch)
tree30f68b00e059945e084c7836ae49c8233a8b4be3 /worktree_test.go
parent9a807f4f29c24bf0dc0b44d7cdfc2233cfd128d3 (diff)
downloadgo-git-2e092f909f643ef455d84dfa59282f0f0adf3c7a.tar.gz
worktree: Status return empty status instead of nil
Diffstat (limited to 'worktree_test.go')
-rw-r--r--worktree_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/worktree_test.go b/worktree_test.go
index f06a1f9..1da86c9 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"
@@ -290,6 +291,22 @@ func (s *WorktreeSuite) TestStatus(c *C) {
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{