code: def test_gh2043p1(path=None):
      # this tests documents the interim agreement on what should happen
      # in the case documented in gh-2043
      ds = Dataset(path).create(force=True)
      ds.save("1")
      assert_repo_status(ds.path, untracked=["2", "3"])
      ds.unlock("1")
      assert_repo_status(
          ds.path,
          # on windows we are in an unlocked branch by default, hence
          # we would see no change
          modified=[] if ds.repo.is_managed_branch() else ["1"],
          untracked=["2", "3"],
      )
      # save(.) should recommit unlocked file, and not touch anything else
      # this tests the second issue in #2043
      with chpwd(path):
          # only save modified bits
          save(path=".", updated=True)
      # state of the file (unlocked/locked) is committed as well, and the
      # test doesn't lock the file again
      assert_repo_status(ds.path, untracked=["2", "3"])
      with chpwd(path):
          # but when a path is given, anything that matches this path
          # untracked or not is added/saved
          save(path=".")
      # state of the file (unlocked/locked) is committed as well, and the
      # test doesn't lock the file again
      assert_repo_status(ds.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 9 for calling a global function with example usage: test_gh2043p1(path) without return types