def test_refresh_with_bad_absolute_git_path_arg(self):
        """Bad absolute path arg is reported and not set."""
        absolute_path = str(Path("yada").absolute())
        expected_pattern = rf"\n[ \t]*cmdline: {re.escape(absolute_path)}\Z"

        with _rollback_refresh() as old_git_executable:
            with self.assertRaisesRegex(GitCommandNotFound, expected_pattern):
                refresh(absolute_path)
            self.assertEqual(self.git.GIT_PYTHON_GIT_EXECUTABLE, old_git_executable)
Bad absolute path arg is reported and not set.
test/test_git.py