code: def test_merge_conflict_in_subdataset_only(path=None):
      path = Path(path)
      ds_src = Dataset(path / "src").create()
      ds_src_sub_conflict = ds_src.create("sub_conflict")
      ds_src_sub_noconflict = ds_src.create("sub_noconflict")
      ds_src.save()
  
      # Set up a scenario where one subdataset has a conflict between the remote
      # and local version, but the parent dataset does not have a conflict
      # because it hasn't recorded the subdataset state.
      ds_clone = install(
          source=ds_src.path,
          path=path / "clone",
          recursive=True,
          result_xfm="datasets",
      )
      ds_clone_sub_conflict = Dataset(path / "clone" / "sub_conflict")
      ds_clone_sub_noconflict = Dataset(
          path / "clone" / "sub_noconflict"
      )
  
      (ds_src_sub_conflict.pathobj / "foo").write_text("src content")
      ds_src_sub_conflict.save(to_git=True)
  
      (ds_clone_sub_conflict.pathobj / "foo").write_text(
          "clone content"
      )
      ds_clone_sub_conflict.save(to_git=True)
  
      (ds_src_sub_noconflict.pathobj / "foo").write_text("src content")
      ds_src_sub_noconflict.save()
  
      res = ds_clone.update(
          merge=True, recursive=True, on_failure="ignore"
      )
      assert_in_results(
          res,
          action="merge",
          status="error",
          path=ds_clone_sub_conflict.path,
      )
      assert_in_results(
          res,
          action="merge",
          status="ok",
          path=ds_clone_sub_noconflict.path,
      )
      assert_in_results(
          res, action="save", status="ok", path=ds_clone.path
      )
      # We saved the subdataset without a conflict...
      assert_repo_status(ds_clone_sub_noconflict.path)
      # ... but the one with the conflict leaves it for the caller to handle.
      ok_(
          ds_clone_sub_conflict.repo.call_git(
              ["ls-files", "--unmerged", "--", "foo"], read_only=True
          ).strip()
      )
  
imports: import os
  import os.path
  from os.path import exists
  from os.path import join
  from unittest.mock import patch
  import pytest
  from datalad import cfg
  from datalad.api import clone, install, remove, update
  from datalad.distribution.update import _process_how_args
  from datalad.support.annexrepo import AnnexRepo
  from datalad.support.external_versions import external_versions
  from datalad.support.gitrepo import GitRepo
  from datalad.tests.utils_pytest import DEFAULT_BRANCH, DEFAULT_REMOTE, SkipTest, assert_false, assert_in, assert_in_results, assert_is_instance, assert_not_in, assert_raises, assert_repo_status, assert_result_count, assert_status, create_tree, eq_, known_failure_windows, maybe_adjust_repo, neq_, ok_, ok_file_has_content, skip_if_adjusted_branch, slow, with_tempfile
  from datalad.utils import Path, chpwd, knows_annex, rmtree
  from ..dataset import Dataset
label_desc: Use image node_id 11 for calling a global function with example usage: test_merge_conflict_in_subdataset_only(path) without return types