code: def test_add_recursive(path=None):
      # make simple hierarchy
      parent = Dataset(path).create()
      assert_repo_status(parent.path)
      sub1 = parent.create(op.join("down", "sub1"))
      assert_repo_status(parent.path)
      sub2 = parent.create("sub2")
      # next one make the parent dirty
      subsub = sub2.create("subsub")
      assert_repo_status(parent.path, modified=["sub2"])
      res = parent.save()
      assert_repo_status(parent.path)
  
      # now add content deep in the hierarchy
      create_tree(subsub.path, {"new": "empty"})
      assert_repo_status(parent.path, modified=["sub2"])
  
      # recursive add should not even touch sub1, because
      # it knows that it is clean
      res = parent.save(recursive=True, jobs=5)
      # the key action is done
      assert_result_count(
          res,
          1,
          path=op.join(subsub.path, "new"),
          action="add",
          status="ok",
      )
      # saved all the way up
      assert_result_count(res, 3, action="save", status="ok")
      assert_repo_status(parent.path)
  
imports: import itertools
  import logging
  import os
  import os.path
  import pytest
  import datalad.utils
  from datalad.api import create, install, save
  from datalad.distribution.dataset import Dataset
  from datalad.support.annexrepo import AnnexRepo
  from datalad.support.exceptions import CommandError
  from datalad.tests.utils_pytest import DEFAULT_BRANCH, OBSCURE_FILENAME, SkipTest, assert_in, assert_in_results, assert_not_in, assert_raises, assert_repo_status, assert_result_count, assert_status, chpwd, create_tree, eq_, known_failure, known_failure_windows, maybe_adjust_repo, neq_, ok_, patch, skip_if_adjusted_branch, skip_wo_symlink_capability, swallow_logs, swallow_outputs, with_tempfile, with_tree
  from datalad.utils import Path, ensure_list, rmtree
label_desc: Use image node_id 18 for calling a global function with example usage: test_add_recursive(path) without return types