code: def test_merge_driver(tmp_dir, scm, dvc):
      tmp_dir.dvc_gen(
          {"data": {"master": "master"}}, commit="master: add data"
      )
  
      with tmp_dir.branch("one", new=True):
          tmp_dir.dvc_gen(
              {"data": {"one": "one"}}, commit="one: add data"
          )
  
      scm.checkout("two", create_new=True)
      dvc.checkout()  # keep things in sync
  
      tmp_dir.dvc_gen({"data": {"two": "two"}}, commit="two: add data")
  
      # installing hook only before merge, as it runs `dvc` commands on
      # `checkouts` and `commits` which slows tests down
      dvc.install()
      (tmp_dir / ".gitattributes").write_text("*.dvc merge=dvc")
  
      scm.gitpython.repo.git.merge(
          "one", m="merged", no_gpg_sign=True, no_signoff=True
      )
  
      # NOTE: dvc shouldn't checkout automatically as it might take a long time
      assert (tmp_dir / "data").read_text() == {
          "master": "master",
          "two": "two",
      }
      assert (tmp_dir / "data.dvc").read_text() == (
          "outs:\n"
          "- md5: 839ef9371606817569c1ee0e5f4ed233.dir\n"
          "  size: 12\n"
          "  nfiles: 3\n"
          "  hash: md5\n"
          "  path: data\n"
      )
  
      dvc.checkout("data.dvc")
      assert (tmp_dir / "data").read_text() == {
          "master": "master",
          "one": "one",
          "two": "two",
      }
  
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 2 for calling a global function with example usage: test_merge_driver(tmp_dir, scm, dvc) without return types