builtin/pack-objects.c: return from create_object_entry()
A new caller in the next commit will want to immediately modify the object_entry structure created by create_object_entry(). Instead of forcing that caller to wastefully look-up the entry we just created, return it from create_object_entry() instead. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Taylor Blau committed
May 20, 2022 at 19:17 UTC
fa23090b0c5cc27d0720535e27236fef9b409efb
1 file changed
+9
-7
builtin/pack-objects.c
+9
-7
@@ -1516,13 +1516,13 @@ static int want_object_in_pack(const struct object_id *oid,
1516
return 1;
1517
}
1518
1519
-static void create_object_entry(const struct object_id *oid,
1520
- enum object_type type,
1521
- uint32_t hash,
1522
- int exclude,
1523
- int no_try_delta,
1524
- struct packed_git *found_pack,
1525
- off_t found_offset)
1519
+static struct object_entry *create_object_entry(const struct object_id *oid,
1520
+ enum object_type type,
1521
+ uint32_t hash,
1522
+ int exclude,
1523
+ int no_try_delta,
1524
+ struct packed_git *found_pack,
1525
+ off_t found_offset)
1526
{
1527
struct object_entry *entry;
1528
@@ -1539,6 +1539,8 @@ static void create_object_entry(const struct object_id *oid,
1539
}
1540
1541
entry->no_try_delta = no_try_delta;
1542
+
1543
+ return entry;
1544
}
1545
1546
static const char no_closure_warning[] = N_(