code: def test_gitrepo_call_git_methods(path=None):
      gr = GitRepo(path)
      gr.add(["foo", "bar"])
      gr.commit(msg="foobar")
      gr.call_git(["mv"], files=["foo", "foo.txt"])
      ok_(op.exists(op.join(gr.path, "foo.txt")))
  
      for expect_fail, check in [
          (False, assert_in),
          (True, assert_not_in),
      ]:
          with swallow_logs(new_level=logging.DEBUG) as cml:
              with assert_raises(CommandError):
                  gr.call_git(
                      ["mv"],
                      files=["notthere", "dest"],
                      expect_fail=expect_fail,
                  )
              check("fatal: bad source", cml.out)
  
      eq_(
          list(gr.call_git_items_(["ls-files"], read_only=True)),
          ["bar", "foo.txt"],
      )
      eq_(
          list(
              gr.call_git_items_(
                  ["ls-files", "-z"], sep="\0", read_only=True
              )
          ),
          ["bar", "foo.txt"],
      )
  
      with assert_raises(AssertionError):
          gr.call_git_oneline(["ls-files"], read_only=True)
  
      eq_(
          gr.call_git_oneline(
              ["ls-files"], files=["bar"], read_only=True
          ),
          "bar",
      )
  
      ok_(
          gr.call_git_success(
              ["rev-parse", "HEAD^{commit}"], read_only=True
          )
      )
      with swallow_logs(new_level=logging.DEBUG) as cml:
          assert_false(
              gr.call_git_success(
                  ["rev-parse", "HEAD^{blob}"], read_only=True
              )
          )
          assert_not_in("expected blob type", cml.out)
  
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 47 for calling a global function with example usage: test_gitrepo_call_git_methods(path) without return types