def METHOD_NAME(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",
    }