code: def git_ls_tree(repo_dir, treeish='HEAD'):
      
      command = ['git', 'ls-tree', '-r', '--full-tree', treeish]
      raw = execute_git_command(command, repo_dir=repo_dir).splitlines()
      output = [l.strip() for l in raw if l.strip()]
      # <mode> <type> <object> <file>
      # make a list of lists with clean elements of equal length
      breakout = [k.split(None, 3) for k in output]
      headers = ['mode', 'type', 'object', 'file']
      return [dict(zip(headers, vals)) for vals in breakout]
docs: Run git ls-tree.