Factor out "read_sha1_file" into mapping/inflating/unmapping.