code: def test_GitRepo_get_merge_base(src=None):
      repo = GitRepo(src, create=True)
      with open(op.join(src, "file.txt"), "w") as f:
          f.write("load")
      repo.add("*")
      repo.commit("committing")
  
      assert_raises(ValueError, repo.get_merge_base, [])
      branch1 = repo.get_active_branch()
      branch1_hexsha = repo.get_hexsha()
      eq_(len(branch1_hexsha), 40)
      eq_(repo.get_merge_base(branch1), branch1_hexsha)
  
      # Let's create a detached branch
      branch2 = "_detach_"
      repo.checkout(branch2, options=["--orphan"])
      # it will have all the files
      # Must not do:  https://github.com/gitpython-developers/GitPython/issues/375
      # repo.git_add('.')
      repo.add("*")
      # NOTE: fun part is that we should have at least a different commit message
      # so it results in a different checksum ;)
      repo.commit("committing again")
      assert repo.get_indexed_files()  # we did commit
      assert repo.get_merge_base(branch1) is None
      assert repo.get_merge_base([branch2, branch1]) is None
  
      # Let's merge them up -- then merge base should match the master
      repo.merge(branch1, allow_unrelated=True)
      eq_(repo.get_merge_base(branch1), branch1_hexsha)
  
      # if points to some empty/non-existing branch - should also be None
      assert repo.get_merge_base(["nonexistent", branch2]) is None
  
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 27 for calling a global function with example usage: test_GitRepo_get_merge_base(src) without return types