Skip to content

Commit 91f88f7

Browse files
ttaylorrgitster
authored andcommitted
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 b0afdce (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 239bd35 commit 91f88f7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pack-bitmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ static struct bitmap *find_boundary_objects(struct bitmap_index *bitmap_git,
11451145

11461146
tmp_blobs = revs->blob_objects;
11471147
tmp_trees = revs->tree_objects;
1148-
tmp_tags = revs->blob_objects;
1148+
tmp_tags = revs->tag_objects;
11491149
revs->blob_objects = 0;
11501150
revs->tree_objects = 0;
11511151
revs->tag_objects = 0;

0 commit comments

Comments
 (0)