code: func Open(s storage.Storer, worktree billy.Filesystem) (*Repository, error) {
  	_, err := s.Reference(plumbing.HEAD)
  	if err == plumbing.ErrReferenceNotFound {
  		return nil, ErrRepositoryNotExists
  	}
  
  	if err != nil {
  		return nil, err
  	}
  
  	return newRepository(s, worktree), nil
  }
docs: // Open opens a git repository using the given Storer and worktree filesystem,
  // if the given storer is complete empty ErrRepositoryNotExists is returned.
  // The worktree can be nil when the repository being opened is bare, if the
  // repository is a normal one (not bare) and worktree is nil the err
  // ErrWorktreeNotProvided is returned