t / t4013 / diff.diff-tree_--pretty_--stat_--summary_initialon commit expose a helper function peel_to_type(). (8177631)
   1$ git diff-tree --pretty --stat --summary initial
   2$