Merge branch 'kg/packed-ref-cache-fix' into next
authorJunio C Hamano <gitster@pobox.com>
Thu, 8 Feb 2018 23:08:25 +0000 (15:08 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 8 Feb 2018 23:08:25 +0000 (15:08 -0800)
commit370f06a56551598416590f37e7ff8df1559e519b
tree3a95fbc57c6690c9f283b44a8e75fe5975524419
parent199ad41486c2d67a17f98bfa869c9fb27c67e3c7
parentba41a8b600871b68680ff33de08012f4887133a2
Merge branch 'kg/packed-ref-cache-fix' into next

Avoid mmapping small files while using packed refs (especially ones
with zero size, which would cause later munmap() to fail).

* kg/packed-ref-cache-fix:
  packed_ref_cache: don't use mmap() for small files
  load_contents(): don't try to mmap an empty file
  packed_ref_iterator_begin(): make optimization more general
  find_reference_location(): make function safe for empty snapshots
  create_snapshot(): use `xmemdupz()` rather than a strbuf
  struct snapshot: store `start` rather than `header_len`
refs/packed-backend.c