Skip to content

Commit 58a6abb

Browse files
ttaylorrvdye
authored andcommitted
builtin/pack-objects.c: avoid redundant NULL check
Before calling `for_each_object_in_pack()`, the caller `read_packs_list_from_stdin()` loops through each of the `include_packs` and checks that its `->util` pointer (which is used to store the `struct packed_git *` itself) is non-NULL. This check is redundant, because `read_packs_list_from_stdin()` already checks that the included packs are non-NULL earlier on in the same function (and it does not add any new entries in between). Remove this check, since it is not doing anything in the meantime. Co-authored-by: Victoria Dye <[email protected]> Signed-off-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 44f9fd6 commit 58a6abb

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

builtin/pack-objects.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3361,8 +3361,6 @@ static void read_packs_list_from_stdin(void)
33613361

33623362
for_each_string_list_item(item, &include_packs) {
33633363
struct packed_git *p = item->util;
3364-
if (!p)
3365-
die(_("could not find pack '%s'"), item->string);
33663364
for_each_object_in_pack(p,
33673365
add_object_entry_from_pack,
33683366
&revs,

0 commit comments

Comments
 (0)