]> git.ipfire.org Git - thirdparty/git.git/commit - packfile.c
for_each_object_in_pack(): clarify pack vs index ordering
authorJeff King <peff@peff.net>
Thu, 14 Jan 2021 20:11:10 +0000 (15:11 -0500)
committerJunio C Hamano <gitster@pobox.com>
Fri, 15 Jan 2021 02:22:27 +0000 (18:22 -0800)
commit779412b9d99544ae71eefabb699a109b1638f96c
tree8859f197d46a91dd0411c55def07d7f3aea748b7
parente5dcd7841828fd4c03dfc8a5c52691ada979b7e2
for_each_object_in_pack(): clarify pack vs index ordering

We may return objects in one of two orders: how they appear in the .idx
(sorted by object id) or how they appear in the packfile itself. To
further complicate matters, we have two ordering variables, "i" and
"pos", and it is not clear to which order they apply.

Let's clarify this by using an unambiguous name where possible, and
leaving a comment for the variable that does double-duty.

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
packfile.c