Skip to content

Commit 87ce294

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 8b7209e commit 87ce294

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
@@ -3493,14 +3493,14 @@ static int add_object_entry_from_pack(const struct object_id *oid,
34933493
return 0;
34943494

34953495
if (p) {
3496-
struct rev_info *revs = _data;
34973496
struct object_info oi = OBJECT_INFO_INIT;
34983497

34993498
oi.typep = &type;
35003499
if (packed_object_info(the_repository, p, ofs, &oi) < 0) {
35013500
die(_("could not get type of object %s in pack %s"),
35023501
oid_to_hex(oid), p->pack_name);
35033502
} else if (type == OBJ_COMMIT) {
3503+
struct rev_info *revs = _data;
35043504
/*
35053505
* commits in included packs are used as starting points for the
35063506
* subsequent revision walk

0 commit comments

Comments
 (0)