code: def test_search_for_most_recent_ancestor(mock_repo):
      # given
      mock_repo.active_branch.tracking_branch.return_value = None
  
      tracking_branch = MagicMock()
      branch = MagicMock()
      branch.tracking_branch.return_value = tracking_branch
      mock_repo.heads = [branch, branch, branch]
  
      mock_repo.is_ancestor.return_value = True
      ancestor = MagicMock()
      ancestor_to_be_chosen = MagicMock()
      ancestor_to_be_chosen.hexsha = "sha1234"
      mock_repo.merge_base.return_value = [
          ancestor,
          ancestor_to_be_chosen,
      ]
  
      # when
      searched_ancestor = search_for_most_recent_ancestor(mock_repo)
  
      # then
      assert searched_ancestor.hexsha == "sha1234"
  
      assert mock_repo.merge_base.call_count == 3
      assert mock_repo.is_ancestor.call_count == 5
  
imports: import datetime
  import git
  from git import Repo
  from mock import MagicMock, patch
  from neptune.internal.utils.git import GitInfo, get_diff, get_relevant_upstream_commit, get_repo_from_git_ref, get_uncommitted_changes, get_upstream_index_sha, search_for_most_recent_ancestor, to_git_info, track_uncommitted_changes
  from neptune.types import GitRef
label_desc: Use image node_id 5 for calling a global function with example usage: test_search_for_most_recent_ancestor(mock_repo) without return types