code: def test_pull_non_workspace(tmp_dir, scm, dvc, erepo_dir):
      with erepo_dir.chdir():
          erepo_dir.dvc_gen(
              "foo", "master content", commit="create foo"
          )
  
          with erepo_dir.branch("branch", new=True):
              erepo_dir.dvc_gen(
                  "foo", "branch content", commit="modify foo"
              )
  
      stage = dvc.imp(
          os.fspath(erepo_dir), "foo", "foo_imported", rev="branch"
      )
      tmp_dir.scm_add([stage.relpath], commit="imported branch")
      scm.tag("ref-to-branch")
  
      # Overwrite via import
      (tmp_dir / "foo_imported").unlink()
      dvc.imp(os.fspath(erepo_dir), "foo", "foo_imported", rev="master")
  
      remove(stage.outs[0].cache_path)
      dvc.fetch(all_tags=True)
      assert os.path.exists(stage.outs[0].cache_path)
  
imports: import filecmp
  import os
  import pytest
  from funcy import first
  from dvc.cachemgr import CacheManager
  from dvc.config import NoRemoteError
  from dvc.dvcfile import load_file
  from dvc.fs import system
  from dvc.scm import Git
  from dvc.stage.exceptions import StagePathNotFoundError
  from dvc.testing.tmp_dir import make_subrepo
  from dvc.utils.fs import remove
  from dvc_data.index.index import DataIndexDirError
label_desc: Use image node_id 20 for calling a global function with example usage: test_pull_non_workspace(tmp_dir, scm, dvc, erepo_dir) without return types