@@ -175,15 +175,6 @@ func Open(s storage.Storer, worktree billy.Filesystem) (*Repository, error) {
175
175
return nil , err
176
176
}
177
177
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
-
187
178
return newRepository (s , worktree ), nil
188
179
}
189
180
@@ -335,6 +326,8 @@ func dotGitFileToOSFilesystem(path string, fs billy.Filesystem) (bfs billy.Files
335
326
// PlainClone a repository into the path with the given options, isBare defines
336
327
// if the new repository will be bare or normal. If the path is not empty
337
328
// ErrRepositoryAlreadyExists is returned.
329
+ //
330
+ // TODO(mcuadros): move isBare to CloneOptions in v5
338
331
func PlainClone (path string , isBare bool , o * CloneOptions ) (* Repository , error ) {
339
332
return PlainCloneContext (context .Background (), path , isBare , o )
340
333
}
@@ -346,6 +339,8 @@ func PlainClone(path string, isBare bool, o *CloneOptions) (*Repository, error)
346
339
// The provided Context must be non-nil. If the context expires before the
347
340
// operation is complete, an error is returned. The context only affects to the
348
341
// transport operations.
342
+ //
343
+ // TODO(mcuadros): move isBare to CloneOptions in v5
349
344
func PlainCloneContext (ctx context.Context , path string , isBare bool , o * CloneOptions ) (* Repository , error ) {
350
345
r , err := PlainInit (path , isBare )
351
346
if err != nil {
0 commit comments