def setup_git_environment() -> None:
    """Set up the environment variables for Git."""
    bundle_dir = os.path.dirname(os.path.abspath(__file__))
    if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"):  # pragma: no cover
        bundled_git_binary_path = os.path.join(bundle_dir, "git")
        os.environ["GIT_PYTHON_GIT_EXECUTABLE"] = bundled_git_binary_path

    if not sys.warnoptions:  # pragma: no cover
        # The warnings filter below can be overridden by passing the -W option
        # to the Python interpreter command line or setting the `PYTHONWARNINGS` environment variable.
        import warnings
        import logging

        # Fuzzing data causes some modules to generate a large number of warnings
        # which are not usually interesting and make the test output hard to read, so we ignore them.
        warnings.simplefilter("ignore")
        logging.getLogger().setLevel(logging.ERROR)
Set up the environment variables for Git.
fuzzing/fuzz-targets/utils.py