code: def branch_blobs(repo, branch):
      """Get all blobs for `branch`.
  
      Parameters
      ----------
      repo : GitRepo
      branch : str
  
      Returns
      -------
      A generator object that returns (hexsha, content, file name) for each blob
      in `branch`.  Note: By design a blob isn't tied to a particular file name;
      the returned file name matches what is returned by 'git rev-list'.
      """
      # Note: This might be nicer with rev-list's --filter and
      # --filter-print-omitted, but those aren't available until Git v2.16.
      lines = repo.call_git_items_(
          ["rev-list", "--objects"] + [branch], read_only=True
      )
      # Trees and blobs have an associated path printed.
      objects = (ln.split() for ln in lines)
      blob_trees = [obj for obj in objects if len(obj) == 2]
  
      num_objects = len(blob_trees)
  
      log_progress(
          lgr.info,
          "repodates_branch_blobs",
          "Checking %d objects",
          num_objects,
          label="Checking objects",
          total=num_objects,
          unit=" objects",
      )
      # This is inefficient.  It makes a git call for each object, some of which
      # aren't even blobs.  We could instead use 'git cat-file --batch'.
      for obj, fname in blob_trees:
          log_progress(
              lgr.info,
              "repodates_branch_blobs",
              "Checking %s",
              obj,
              increment=True,
              update=1,
          )
          content = _cat_blob(repo, obj, bad_ok=True)
          if content:
              yield obj, content, fname
      log_progress(
          lgr.info,
          "repodates_branch_blobs",
          "Finished checking %d objects",
          num_objects,
      )
  
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 2 for calling a global function with example usage: branch_blobs(repo, branch) without return types