code: func PlainCloneContext(ctx context.Context, path string, isBare bool, o *CloneOptions) (*Repository, error) {
  	cleanup, cleanupParent, err := checkIfCleanupIsNeeded(path)
  	if err != nil {
  		return nil, err
  	}
  
  	r, err := PlainInit(path, isBare)
  	if err != nil {
  		return nil, err
  	}
  
  	err = r.clone(ctx, o)
  	if err != nil && err != ErrRepositoryAlreadyExists {
  		if cleanup {
  			cleanUpDir(path, cleanupParent)
  		}
  	}
  
  	return r, err
  }
docs: // PlainCloneContext a repository into the path with the given options, isBare
  // defines if the new repository will be bare or normal. If the path is not empty
  // ErrRepositoryAlreadyExists is returned.
  //
  // The provided Context must be non-nil. If the context expires before the
  // operation is complete, an error is returned. The context only affects to the
  // transport operations.
  //
  // TODO(mcuadros): move isBare to CloneOptions in v5
  // TODO(smola): refuse upfront to clone on a non-empty directory in v5, see #1027