lsTree method

Future<List<TreeEntry>> lsTree(
  1. String treeish, {
  2. bool subTreesOnly = false,
  3. String? path,
})

Implementation

Future<List<TreeEntry>> lsTree(
  String treeish, {
  bool subTreesOnly = false,
  String? path,
}) async {
  final args = ['ls-tree'];

  if (subTreesOnly == true) {
    args.add('-d');
  }

  args.add(treeish);

  if (path != null) {
    args.add(path);
  }

  final pr = await runCommand(args);
  return TreeEntry.fromLsTreeOutput(pr.stdout as String);
}