only call rev-parse and cat-file for size and type when needed