code: def test_parent_on_unborn_branch(path=None):
      from datalad.support.gitrepo import GitRepo
  
      ds = Dataset(GitRepo(path, create=True).path)
      assert_false(ds.repo.get_hexsha())
  
      subrepo = GitRepo(opj(path, "sub"), create=True)
      subrepo.commit(msg="c", options=["--allow-empty"])
  
      ds.repo.save(path="sub")
      eq_(ds.subdatasets(result_xfm="relpaths"), ["sub"])
  
file_path: datalad/datalad/local/tests/test_subdataset.py
imports: import os
  from os.path import join
  from os.path import pardir, relpath
  from datalad.api import clone, create, subdatasets
  from datalad.distribution.dataset import Dataset
  from datalad.tests.utils_pytest import assert_false, assert_in, assert_not_in, assert_repo_status, assert_result_count, assert_status, assert_true, eq_, slow, with_tempfile
  from datalad.utils import Path, PurePosixPath, chpwd
label_desc: Use image node_id 5 for calling a global function with example usage: test_parent_on_unborn_branch(path) without return types