def METHOD_NAME(self):
    with temporary_dir() as d:
        repo = mock.Mock(spec=Repository)
        repo.create_commit.return_value = None
        repo.tree = mock.Mock(
            return_value=Tree(
                {"url": "string", "sha": "tree-ish-hash", "tree": []}, None
            )
        )
        with open("new", "w") as f:
            f.write("new")
        commit = CommitDir(repo)
        with pytest.raises(GithubException):
            commit(d, "main", commit_message="msg")