reading tree
using same format of cat-file -p