def METHOD_NAME(tmp_dir, scm, dvc):
    with tmp_dir.branch("one", new=True):
        tmp_dir.dvc_gen({"data": {"foo": "foo"}}, commit="one: add data")
    scm.checkout("two", create_new=True)
    dvc.checkout()  # keep things in sync
    tmp_dir.dvc_gen({"data": {"bar": "bar"}}, commit="two: add data")
    # installing hook only before merge, as it runs `dvc` commands which makes
    # `checkouts` and `commits` above slower
    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() == {"bar": "bar"}
    assert (tmp_dir / "data.dvc").read_text() == (
        "outs:\n"
        "- md5: 5ea40360f5b4ec688df672a4db9c17d1.dir\n"
        "  size: 6\n"
        "  nfiles: 2\n"
        "  hash: md5\n"
        "  path: data\n"
    )
    dvc.checkout("data.dvc")
    assert (tmp_dir / "data").read_text() == {"foo": "foo", "bar": "bar"}