def METHOD_NAME(self, url: str) -> str:
    search_branch = re.search(BRANCH_PATTERN, url)
    if search_branch:
        self.branch = search_branch.group("branch")
        # remove heads/ from ref= to get actual branch name
        # self.branch = re.sub('heads.*/', '', url)
        url = re.sub(BRANCH_PATTERN, '', url)
        return url
    search_commit_id = re.search(COMMIT_ID_PATTERN, url)
    if search_commit_id:
        self.commit_id = search_commit_id.group("commit_id")
        url = re.sub(COMMIT_ID_PATTERN, '', url)
        return url
    search_tag = re.search(TAG_PATTERN, url)
    if search_tag:
        self.tag = search_tag.group("tag")
        # remove tag/ or tags/ from ref= to get actual branch name
        self.tag = re.sub('tag.*/', '', self.tag)
        url = re.sub(TAG_PATTERN, '', url)
        return url
    logging.info(f"Module URL has an unknown ref: {url}")
    return url