sha1_file.c: introduce GIT_MMAP_LIMIT to limit mmap size
Similar to testing expectations about malloc with GIT_ALLOC_LIMIT
introduced in
d41489a6 (Add more large blob test cases, 2012-03-07),
it can be useful to test expectations about mmap.
Introduce a new environment variable GIT_MMAP_LIMIT to limit the
largest allowed mmap length (in KB). xmmap() is modified to check
the limit. Together with GIT_ALLOC_LIMIT tests can now easily
confirm expectations about memory consumption.
GIT_MMAP_LIMIT will be used in the next commit to test that data
will be streamed to an external filter without mmaping the entire
file.
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>