@@ -175,15 +175,6 @@ func Open(s storage.Storer, worktree billy.Filesystem) (*Repository, error) {
175175 return nil , err
176176 }
177177
178- cfg , err := s .Config ()
179- if err != nil {
180- return nil , err
181- }
182-
183- if ! cfg .Core .IsBare && worktree == nil {
184- return nil , ErrWorktreeNotProvided
185- }
186-
187178 return newRepository (s , worktree ), nil
188179}
189180
@@ -335,6 +326,8 @@ func dotGitFileToOSFilesystem(path string, fs billy.Filesystem) (bfs billy.Files
335326// PlainClone a repository into the path with the given options, isBare defines
336327// if the new repository will be bare or normal. If the path is not empty
337328// ErrRepositoryAlreadyExists is returned.
329+ //
330+ // TODO(mcuadros): move isBare to CloneOptions in v5
338331func PlainClone (path string , isBare bool , o * CloneOptions ) (* Repository , error ) {
339332 return PlainCloneContext (context .Background (), path , isBare , o )
340333}
@@ -346,6 +339,8 @@ func PlainClone(path string, isBare bool, o *CloneOptions) (*Repository, error)
346339// The provided Context must be non-nil. If the context expires before the
347340// operation is complete, an error is returned. The context only affects to the
348341// transport operations.
342+ //
343+ // TODO(mcuadros): move isBare to CloneOptions in v5
349344func PlainCloneContext (ctx context.Context , path string , isBare bool , o * CloneOptions ) (* Repository , error ) {
350345 r , err := PlainInit (path , isBare )
351346 if err != nil {
0 commit comments