func parseModuleReferenceComponents(path string) (remote string, owner string, repository string, ref string, err error) {
	remote, owner, rest, err := parseModuleIdentityComponents(path)
	if err != nil {
		return "", "", "", "", newInvalidModuleReferenceStringError(path)
	}
	restSplit := strings.Split(rest, ":")
	repository = strings.TrimSpace(restSplit[0])
	if len(restSplit) == 1 {
		return remote, owner, repository, "", nil
	}
	if len(restSplit) == 2 {
		ref := strings.TrimSpace(restSplit[1])
		if ref == "" {
			return "", "", "", "", newInvalidModuleReferenceStringError(path)
		}
		return remote, owner, repository, ref, nil
	}
	return "", "", "", "", newInvalidModuleReferenceStringError(path)
}
// parseModuleReferenceComponents parses and returns the remote, owner, repository,
// and ref (branch or commit) from the given path.
parseModuleReferenceComponents parses and returns the remote, owner, repository,
and ref (branch or commit) from the given path.
// parseModuleReferenceComponents parses and returns the remote owner repository // and ref ( branch or commit ) from the given path .
func parseModuleReferenceComponents(path string) (remote string, owner string, repository string, ref string, err error) {
	remote, owner, rest, err := parseModuleIdentityComponents(path)
	if err != nil {
		return "", "", "", "", newInvalidModuleReferenceStringError(path)
	}
	restSplit := strings.Split(rest, ":")
	repository = strings.TrimSpace(restSplit[0])
	if len(restSplit) == 1 {
		return remote, owner, repository, "", nil
	}
	if len(restSplit) == 2 {
		ref := strings.TrimSpace(restSplit[1])
		if ref == "" {
			return "", "", "", "", newInvalidModuleReferenceStringError(path)
		}
		return remote, owner, repository, ref, nil
	}
	return "", "", "", "", newInvalidModuleReferenceStringError(path)
}
func parseModuleReferenceComponents ( path string ) ( remote string , owner string , repository string , ref string , err error ) { remote , owner , rest , err := parseModuleIdentityComponents ( path ) if err != nil { return " " , " " , " " , " " , newInvalidModuleReferenceStringError ( path ) } restSplit := strings . Split ( rest , " " ) repository = strings . TrimSpace ( restSplit [ 0 ] ) if len ( restSplit ) == 1 { return remote , owner , repository , " " , nil } if len ( restSplit ) == 2 { ref := strings . TrimSpace ( restSplit [ 1 ] ) if ref == " " { return " " , " " , " " , " " , newInvalidModuleReferenceStringError ( path ) } return remote , owner , repository , ref , nil } return " " , " " , " " , " " , newInvalidModuleReferenceStringError ( path ) }
parseModuleReferenceComponents parses and returns the remote, owner, repository,
and ref (branch or commit) from the given path.
parseModuleReferenceComponents parses and returns the remote owner repository and ref ( branch or commit ) from the given path .