diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2018-10-15 11:16:42 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2018-10-15 11:16:42 +0200 |
commit | 987c03a3cef828894fabe4ffdcafd2a90e908e4a (patch) | |
tree | fe618979bcf565e093749f6b0886a735b62404d8 /repository_test.go | |
parent | f69f5304328165153e452382f44aa2b41df36d0f (diff) | |
download | go-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.go | 10 |
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) { |