]> git.ipfire.org Git - thirdparty/git.git/commit
read-cache.c: do not die if mmap fails
authorVarun Naik <vcnaik94@gmail.com>
Sun, 14 Jul 2019 03:01:53 +0000 (20:01 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 14 Jul 2019 22:22:29 +0000 (15:22 -0700)
commit02638d1e1153eb89d51a72de51ad854a88c9a178
treea7088f78e1e48ec38c3830041fd43ba6da2040da
parentb697d92f56511e804b8ba20ccbe7bdc85dc66810
read-cache.c: do not die if mmap fails

do_read_index() mmaps the index, or tries to die with an error message
on failure. It should call xmmap_gently(), which returns MAP_FAILED,
rather than xmmap(), which dies with its own error message.

An easy way to cause this mmap to fail is by setting $GIT_INDEX_FILE to
a path to a directory and then invoking any command that reads from the
index.

Signed-off-by: Varun Naik <vcnaik94@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
read-cache.c