]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/pack-objects.c
pack-objects: split add_object_entry
authorJeff King <peff@peff.net>
Sat, 21 Dec 2013 14:00:06 +0000 (09:00 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 30 Dec 2013 20:19:22 +0000 (12:19 -0800)
commitce2bc42456b88c5f01f7f591cf0cc9db1a5bfc3d
tree23c9b509bb3da570efbb5e509a0b08901e369d34
parentfff42755efc7585378ca562e54828532922371be
pack-objects: split add_object_entry

This function actually does three things:

  1. Check whether we've already added the object to our
     packing list.

  2. Check whether the object meets our criteria for adding.

  3. Actually add the object to our packing list.

It's a little hard to see these three phases, because they
happen linearly in the rather long function. Instead, this
patch breaks them up into three separate helper functions.

The result is a little easier to follow, though it
unfortunately suffers from some optimization
interdependencies between the stages (e.g., during step 3 we
use the packing list index from step 1 and the packfile
information from step 2).

More importantly, though, the various parts can be
composed differently, as they will be in the next patch.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/pack-objects.c