sha1_file: remove recursion in unpack_entry
authorThomas Rast <trast@student.ethz.ch>
Wed, 27 Mar 2013 20:03:42 +0000 (21:03 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 Mar 2013 20:25:16 +0000 (13:25 -0700)
Similar to the recursion in packed_object_info(), this leads to
problems on stack-space-constrained systems in the presence of long
delta chains.

We proceed in three phases:

1. Dig through the delta chain, saving each delta object's offsets and
size on an ad-hoc stack.

2. Unpack the base object at the bottom.

3. Unpack and apply the deltas from the stack.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found