code: def test_GitRepo_fetch(orig_path=None, clone_path=None):
      origin = GitRepo(orig_path)
      with open(op.join(orig_path, "some.txt"), "w") as f:
          f.write("New text file.")
      origin.add("some.txt")
      origin.commit("new file added.")
  
      clone = GitRepo.clone(orig_path, clone_path)
      filename = get_most_obscure_supported_name()
  
      origin.checkout("new_branch", ["-b"])
      with open(op.join(orig_path, filename), "w") as f:
          f.write("New file.")
      origin.add(filename)
      origin.commit("new file added.")
  
      fetched = clone.fetch(remote=DEFAULT_REMOTE)
      # test FetchInfo list returned by fetch
      eq_(
          [
              DEFAULT_REMOTE + "/" + clone.get_active_branch(),
              DEFAULT_REMOTE + "/new_branch",
          ],
          [commit["ref"] for commit in fetched],
      )
  
      assert_repo_status(clone.path, annex=False)
      assert_in(
          DEFAULT_REMOTE + "/new_branch", clone.get_remote_branches()
      )
      assert_in(
          filename, clone.get_files(DEFAULT_REMOTE + "/new_branch")
      )
      assert_false(
          op.exists(op.join(clone_path, filename))
      )  # not checked out
  
      # create a remote without an URL:
      origin.add_remote(
          "not-available", "git://example.com/not/existing"
      )
      origin.config.unset("remote.not-available.url", scope="local")
  
      # fetch without provided URL
      assert_raises(CommandError, origin.fetch, "not-available")
  
imports: import logging
  import os
  import os.path
  import sys
  import pytest
  from datalad import get_encoding_info
  from datalad.cmd import StdOutCapture, StdOutErrCapture, WitlessRunner
  from datalad.support.exceptions import CommandError, FileNotInRepositoryError, InvalidGitRepositoryError, NoSuchPathError, PathKnownToRepositoryError
  from datalad.support.external_versions import external_versions
  from datalad.support.gitrepo import GitRepo, _normalize_path, normalize_paths, to_options
  from datalad.support.sshconnector import get_connection_hash
  from datalad.tests.utils_pytest import DEFAULT_BRANCH, DEFAULT_REMOTE, SkipTest, assert_cwd_unchanged, assert_equal, assert_false, assert_in, assert_in_results, assert_is_instance, assert_not_equal, assert_not_in, assert_raises, assert_repo_status, assert_true, create_tree, eq_, get_most_obscure_supported_name, integration, neq_, ok_, skip_if_no_network, skip_if_on_windows, skip_nomultiplex_ssh, slow, swallow_logs, with_tempfile, with_tree, xfail_buggy_annex_info
  from datalad.utils import Path, chpwd, getpwd, on_windows, rmtree
label_desc: Use image node_id 18 for calling a global function with example usage: test_GitRepo_fetch(orig_path, clone_path) without return types