The git_mmap implementation was broken for file sizes that wouldn't fit into a size_t (32 bits). Changed 'len' to be stored in an off_t (64 bit) variable, and moved the xsize_t cast to only occur when an attempt is made to map past the end-of-file.