From documentation, in order to use git ls-tree
you need to pass the hash of a tree object. What if I want to obtain the same output of git ls-tree
starting from a commit object.
I can obviously do it with something like this:
git ls-tree $(git cat-file -p my_commit | grep -oP "(?<=tree ).*")
But I feel like I am reinventing the wheel. Is there a git command that already does this?