alternates: provide helper for allocating alternate
commit7f0fa2c02a6543bdadae3c4a492daae7dbc8c042
authorJeff King <peff@peff.net>
Mon, 3 Oct 2016 20:35:31 +0000 (3 16:35 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Oct 2016 20:52:36 +0000 (10 13:52 -0700)
tree5fc856fb9a95e4e5edc2c5d2c980d14f984ce8a8
parenta5b34d21521c015cd41ced4a3fdde57d79891eb3
alternates: provide helper for allocating alternate

Allocating a struct alternate_object_database is tricky, as
we must over-allocate the buffer to provide scratch space,
and then put in particular '/' and NUL markers.

Let's encapsulate this in a function so that the complexity
doesn't leak into callers (and so that we can modify it
later).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h
sha1_file.c
sha1_name.c