code: def test_pre_commit_hook(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")
  
file_path: dvc/tests/func/test_install.py
imports: import os
  import pathlib
  import sys
  import pytest
  from git import GitCommandError
  from dvc.exceptions import DvcException
  from dvc_data.hashfile.hash import file_md5
  from tests.func.parsing.test_errors import escape_ansi
label_desc: Use image node_id 5 for calling the TestInstall obj's underlying member method code with example usage: obj.test_pre_commit_hook(tmp_dir, scm, dvc, caplog) without return types