This was probably a mistake in the DirCacheEntry API.  We should overload setLength() to accept a long so application level code doesn't have to do this type cast.  Its likely that some day the Git index file format will support files >4 GiB and applications shouldn't have to go change their code when that occurs.