def METHOD_NAME(self, tmp_dir, scm, dvc, caplog):
    tmp_dir.dvc_gen("file", "file content", commit="create foo")
    tmp_dir.gen("file", "file modified")
    dvc.install()
    # scm.commit bypasses hooks
    with pytest.raises(GitCommandError, match=r"modified:\s*file"):
        scm.gitpython.repo.git.commit(m="file modified")