code: def test_commit_force(tmp_dir, dvc):
      tmp_dir.gen({"dir": {"file": "text1", "file2": "text2"}})
      (stage,) = dvc.add("dir", no_commit=True)
  
      assert stage.outs[0].changed_cache()
  
      tmp_dir.gen("dir/file", "file content modified")
  
      assert stage.outs[0].changed_cache()
  
      with pytest.raises(StageCommitError):
          dvc.commit(stage.path)
  
      assert stage.outs[0].changed_cache()
  
      dvc.commit(stage.path, force=True)
      assert dvc.status([stage.path]) == {}
  
imports: import os
  import textwrap
  import pytest
  from dvc.dependency.base import DependencyDoesNotExistError
  from dvc.dvcfile import PROJECT_FILE
  from dvc.fs import localfs
  from dvc.output import OutputDoesNotExistError
  from dvc.stage.exceptions import StageCommitError
label_desc: Use image node_id 2 for calling a global function with example usage: test_commit_force(tmp_dir, dvc) without return types