Optimize the common cases of git-read-tree