]> git.ipfire.org Git - thirdparty/git.git/commit
pack-bitmap.c: typofix in `find_boundary_objects()`
authorTaylor Blau <me@ttaylorr.com>
Thu, 21 Nov 2024 22:50:43 +0000 (17:50 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 21 Nov 2024 23:57:18 +0000 (08:57 +0900)
commit91f88f76e631a60b51a4814d938f18587f5e2210
tree3060b68e0f90ff683e2c5cc65046fb700a88add9
parent239bd35bd2ed2791398714d99b43a344728766ab
pack-bitmap.c: typofix in `find_boundary_objects()`

In the boundary-based bitmap traversal, we use the given 'rev_info'
structure to first do a commit-only walk in order to determine the
boundary between interesting and uninteresting objects.

That walk only looks at commit objects, regardless of the state of
revs->blob_objects, revs->tree_objects, and so on. In order to do this,
we store the state of these variables in temporary fields before
setting them back to zero, performing the traversal, and then setting
them back.

But there is a typo here that dates back to b0afdce5da (pack-bitmap.c:
use commit boundary during bitmap traversal, 2023-05-08), where we
incorrectly store the value of the "tags" field as "revs->blob_objects".

This could lead to problems later on if, say, the caller wants tag
objects but *not* blob objects. In the pre-image behavior, we'd set
revs->tag_objects back to the old value of revs->blob_objects, thus
emitting fewer objects than expected back to the caller.

Fix that by correctly assigning the value of 'revs->tag_objects' to the
'tmp_tags' field.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pack-bitmap.c