def METHOD_NAME(dirname):
    if not have_gitpython:
        return
    try:
        repo = Repo(dirname, search_parent_directories=True)
    except InvalidGitRepositoryError:
        print("Couldn't find git info")
        return
    cur_commit = repo.commit()
    cur_branch = repo.active_branch
    print("Git info:")
    print(f"\tCurrent commit {cur_commit.hexsha} from branch {cur_branch.name}")
    try:
        # EDG: Git is insane, but this should work 99% of the time
        cur_tb = cur_branch.tracking_branch()
        if cur_tb.is_remote():
            remote_name = cur_tb.remote_name
            remote_url = repo.remotes[remote_name].url
            print(f"\tChecked out from remote {remote_name}: {remote_url}")
        else:
            print("Tracking local branch %s" % cur_tb.name)
    except Exception:  # pylint: disable=broad-except
        print("Could not resolve tracking branch or remote info!")