def _insert_token_to_repo_url(url, token):
    """Insert the token to the Git repo url, to make a component of the git
    clone command. This method can only be called when repo_url is an https url.

    Args:
        url (str): Git repo url where the token should be inserted into.
        token (str): Token to be inserted.

    Returns:
        str: the component needed fot the git clone command.
    """
    index = len("https://")
    if url.find(token) == index:
        return url
    return url.replace("https://", "https://" + token + "@")