aboutsummaryrefslogtreecommitdiffstats
path: root/repository_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2018-10-15 11:16:42 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2018-10-15 11:16:42 +0200
commit987c03a3cef828894fabe4ffdcafd2a90e908e4a (patch)
treefe618979bcf565e093749f6b0886a735b62404d8 /repository_test.go
parentf69f5304328165153e452382f44aa2b41df36d0f (diff)
downloadgo-git-987c03a3cef828894fabe4ffdcafd2a90e908e4a.tar.gz
repository: allow open non-bare repositories as bare
Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
Diffstat (limited to 'repository_test.go')
-rw-r--r--repository_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/repository_test.go b/repository_test.go
index 2710d9d..3179d51 100644
--- a/repository_test.go
+++ b/repository_test.go
@@ -143,7 +143,7 @@ func (s *RepositorySuite) TestOpenBare(c *C) {
c.Assert(r, NotNil)
}
-func (s *RepositorySuite) TestOpenMissingWorktree(c *C) {
+func (s *RepositorySuite) TestOpenBareMissingWorktree(c *C) {
st := memory.NewStorage()
r, err := Init(st, memfs.New())
@@ -151,8 +151,8 @@ func (s *RepositorySuite) TestOpenMissingWorktree(c *C) {
c.Assert(r, NotNil)
r, err = Open(st, nil)
- c.Assert(err, Equals, ErrWorktreeNotProvided)
- c.Assert(r, IsNil)
+ c.Assert(err, IsNil)
+ c.Assert(r, NotNil)
}
func (s *RepositorySuite) TestOpenNotExists(c *C) {
@@ -425,8 +425,8 @@ func (s *RepositorySuite) TestPlainOpenNotBare(c *C) {
c.Assert(r, NotNil)
r, err = PlainOpen(filepath.Join(dir, ".git"))
- c.Assert(err, Equals, ErrWorktreeNotProvided)
- c.Assert(r, IsNil)
+ c.Assert(err, IsNil)
+ c.Assert(r, NotNil)
}
func (s *RepositorySuite) testPlainOpenGitFile(c *C, f func(string, string) string) {