alloc: factor out commit index
commit94d5a22cf651174f91d40a140593628a04fdacf3
authorJeff King <peff@peff.net>
Sun, 13 Jul 2014 06:42:08 +0000 (13 02:42 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 14 Jul 2014 01:59:05 +0000 (13 18:59 -0700)
treee07d447848193680f33a628cad544c0b5cdfe540
parent8ff226a9d5ee065fe52752e6032f63cb6e4beccb
alloc: factor out commit index

We keep a static counter to set the commit index on newly
allocated objects. However, since we also need to set the
index on any_objects which are converted to commits, let's
make the counter available as a public function.

While we're moving it, let's make sure the counter is
allocated as an unsigned integer to match the index field in
"struct commit".

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