code: def test_GitRepo_get_files(src_path=None, path=None):
      src = GitRepo(src_path)
      for filename in ("some1.txt", "some2.dat"):
          with open(op.join(src_path, filename), "w") as f:
              f.write(filename)
          src.add(filename)
      src.commit("Some files")
  
      gr = GitRepo.clone(src.path, path)
      # get the expected files via os for comparison:
      os_files = set()
      for dirpath, dirnames, filenames in os.walk(path):
          rel_dir = os.path.relpath(dirpath, start=path)
          if rel_dir.startswith(".git"):
              continue
          for file_ in filenames:
              file_path = os.path.normpath(op.join(rel_dir, file_))
              os_files.add(file_path)
  
      # get the files via GitRepo:
      local_files = set(gr.get_files())
      remote_files = set(
          gr.get_files(branch=f"{DEFAULT_REMOTE}/{DEFAULT_BRANCH}")
      )
  
      eq_(local_files, set(gr.get_indexed_files()))
      eq_(local_files, remote_files)
      eq_(local_files, os_files)
  
      # create a different branch:
      gr.checkout("new_branch", ["-b"])
      filename = "another_file.dat"
      with open(op.join(path, filename), "w") as f:
          f.write("something")
      gr.add(filename)
      gr.commit("Added.")
  
      # now get the files again:
      local_files = set(gr.get_files())
      eq_(local_files, os_files.union({filename}))
      # retrieve remote branch again, which should not have changed:
      remote_files = set(
          gr.get_files(branch=f"{DEFAULT_REMOTE}/{DEFAULT_BRANCH}")
      )
      eq_(remote_files, os_files)
      eq_(set([filename]), local_files.difference(remote_files))
  
      # switch back and query non-active branch:
      gr.checkout(DEFAULT_BRANCH)
      local_files = set(gr.get_files())
      branch_files = set(gr.get_files(branch="new_branch"))
      eq_(set([filename]), branch_files.difference(local_files))
  
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 24 for calling a global function with example usage: test_GitRepo_get_files(src_path, path) without return types