Skip to content

Commit 9809d4a

Browse files
ttaylorrgitster
authored andcommitted
pack-objects: limit scope in 'add_object_entry_from_pack()'
In add_object_entry_from_pack() we declare 'revs' (given to us through the miscellaneous context argument) earlier in the "if (p)" conditional than is necessary. Move it down as far as it can go to reduce its scope. Signed-off-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 798ddd9 commit 9809d4a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/pack-objects.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3725,14 +3725,14 @@ static int add_object_entry_from_pack(const struct object_id *oid,
37253725
return 0;
37263726

37273727
if (p) {
3728-
struct rev_info *revs = _data;
37293728
struct object_info oi = OBJECT_INFO_INIT;
37303729

37313730
oi.typep = &type;
37323731
if (packed_object_info(the_repository, p, ofs, &oi) < 0) {
37333732
die(_("could not get type of object %s in pack %s"),
37343733
oid_to_hex(oid), p->pack_name);
37353734
} else if (type == OBJ_COMMIT) {
3735+
struct rev_info *revs = _data;
37363736
/*
37373737
* commits in included packs are used as starting points for the
37383738
* subsequent revision walk

0 commit comments

Comments
 (0)