code: def branch_blobs_in_tree(repo, branch):
      """Get all blobs for the current tree of `branch`.
  
      Parameters
      ----------
      repo : GitRepo
      branch : str, optional
  
      Returns
      -------
      A generator object that returns (hexsha, content, file name) for each blob.
      Note: If there are multiple files in the tree that point to the blob, only
      the first file name that is reported by 'git ls-tree' is used (i.e., one
      entry per blob is yielded).
      """
      seen_blobs = set()
      lines = list(
          repo.call_git_items_(
              ["ls-tree", "-z", "-r", branch], sep="\0", read_only=True
          )
      )
      if lines:
          num_lines = len(lines)
          log_progress(
              lgr.info,
              "repodates_blobs_in_tree",
              "Checking %d objects in git-annex tree",
              num_lines,
              label="Checking objects",
              total=num_lines,
              unit=" objects",
          )
          for line in lines:
              if not line:
                  continue
              _, obj_type, obj, fname = line.split()
              log_progress(
                  lgr.info,
                  "repodates_blobs_in_tree",
                  "Checking %s",
                  obj,
                  increment=True,
                  update=1,
              )
              if obj_type == "blob" and obj not in seen_blobs:
                  yield obj, _cat_blob(repo, obj), fname
              seen_blobs.add(obj)
          log_progress(
              lgr.info,
              "repodates_blobs_in_tree",
              "Finished checking %d blobs",
              num_lines,
          )
  
file_path: datalad/datalad/support/repodates.py
imports: import logging
  import operator
  import re
  import time
  from datalad.log import log_progress
  from datalad.support.exceptions import CommandError
  from datalad.support.gitrepo import GitRepo
label_desc: Use image node_id 3 for calling a global function with example usage: branch_blobs_in_tree(repo, branch) without return types