def geturl(repo):
    """
    Get the origin url if present
    :param repo:
    :return:
    """
    if repo.remotes:
        for remote in repo.remotes:
            if hasattr(remote, 'name'):
                name = remote.name
                if name == 'origin':
                    url = remote.url
                    if '@' in url and url.startswith('http'):
                        protocol, rest = url.split('//', 1)
                        _, address = rest.split('@', 1)
                        url = '{}//{}'.format(protocol, address)
                    return url
    return None
