modified to mimic git-ls-tree further