multi-pack-index: verify bad header
commit53ad0407444ac4da835dbe9cf85c272b4065f3b4
authorDerrick Stolee <dstolee@microsoft.com>
Thu, 13 Sep 2018 18:02:15 +0000 (13 11:02 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Sep 2018 20:49:41 +0000 (17 13:49 -0700)
tree76c52fc66e481f756f2486e5e5f017fbd7e5c598
parent56ee7ff15655fa1c9a1368ddd717fc84556359bc
multi-pack-index: verify bad header

When verifying if a multi-pack-index file is valid, we want the
command to fail to signal an invalid file. Previously, we wrote
an error to stderr and continued as if we had no multi-pack-index.
Now, die() instead of error().

Add tests that check corrupted headers in a few ways:

* Bad signature
* Bad file version
* Bad hash version
* Truncated hash count
* Extended hash count

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
midx.c
t/t5319-multi-pack-index.sh