code: def test_branch_config(tmp_dir, scm):
      tmp_dir.scm_gen("foo", "foo", commit="init")
  
      # sanity check
      with pytest.raises(NotDvcRepoError):
          Repo().close()
  
      scm.checkout("branch", create_new=True)
      dvc = Repo.init()
      with dvc.config.edit() as conf:
          conf["remote"]["branch"] = {"url": "/some/path"}
      dvc.close()
  
      scm.add([os.path.join(".dvc", "config")])
      scm.commit("init dvc")
      scm.checkout("master")
  
      with pytest.raises(NotDvcRepoError):
          Repo(rev="master").close()
  
      dvc = Repo(rev="branch")
      try:
          assert dvc.config["remote"]["branch"]["url"] == "/some/path"
      finally:
          dvc.close()
  
file_path: dvc/tests/unit/repo/test_repo.py
imports: import os
  import shutil
  import pytest
  from dvc.exceptions import OutputDuplicationError
  from dvc.repo import NotDvcRepoError, Repo, locked
  from dvc_data.hashfile.hash_info import HashInfo
label_desc: Use image node_id 7 for calling a global function with example usage: test_branch_config(tmp_dir, scm) without return types