datalad_next.iter_collections.iter_gittree
- datalad_next.iter_collections.iter_gittree(path: Path, treeish: str, *, recursive: str = 'repository') Generator[GitTreeItem, None, None] [source]
Uses
git ls-tree
to report on a tree in a Git repository- Parameters:
path (Path) -- Path of a directory in a Git repository to report on. This directory need not be the root directory of the repository, but must be part of the repository. If the directory is not the root directory of a non-bare repository, the iterator is constrained to items underneath that directory.
recursive ({'repository', 'no'}, optional) -- Behavior for recursion into subtrees. By default (
repository
), all tree within the repository underneathpath
) are reported, but not tree within submodules. Ifno
, only direct children are reported on.
- Yields:
GitTreeItem
-- Thename
attribute of an item is astr
with the corresponding (relative) path, as reported by Git (in POSIX conventions).