read_packed_refs(): die if `packed-refs` contains bogus data
commit9308b7f3ca9bbe7e76b16c832617a8c6aea5ade3
authorMichael Haggerty <mhagger@alum.mit.edu>
Sat, 1 Jul 2017 18:31:08 +0000 (1 20:31 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 3 Jul 2017 17:01:57 +0000 (3 10:01 -0700)
tree600c37ecabfa3871dafdb87914f23e89184b0f78
parent02a1a42056bd2e34f872d61e2ec7aa00dd43422b
read_packed_refs(): die if `packed-refs` contains bogus data

The old code ignored any lines that it didn't understand, including
unterminated lines. This is dangerous. Instead, `die()` if the
`packed-refs` file contains any unterminated lines or lines that we
don't know how to handle.

This fixes the tests added in the last commit.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs/packed-backend.c
t/t3210-pack-refs.sh