]> git.ipfire.org Git - thirdparty/git.git/commitdiff
builtin/pack-objects.c: return from create_object_entry()
authorTaylor Blau <me@ttaylorr.com>
Fri, 20 May 2022 23:17:49 +0000 (19:17 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 26 May 2022 22:48:26 +0000 (15:48 -0700)
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>
builtin/pack-objects.c

index 6ac927047cf4563cff2ec575305cb01cad7084f5..c6d16872ee1f2be062184184496a76c0d9b0e1d4 100644 (file)
@@ -1516,13 +1516,13 @@ static int want_object_in_pack(const struct object_id *oid,
        return 1;
 }
 
-static void create_object_entry(const struct object_id *oid,
-                               enum object_type type,
-                               uint32_t hash,
-                               int exclude,
-                               int no_try_delta,
-                               struct packed_git *found_pack,
-                               off_t found_offset)
+static struct object_entry *create_object_entry(const struct object_id *oid,
+                                               enum object_type type,
+                                               uint32_t hash,
+                                               int exclude,
+                                               int no_try_delta,
+                                               struct packed_git *found_pack,
+                                               off_t found_offset)
 {
        struct object_entry *entry;
 
@@ -1539,6 +1539,8 @@ static void create_object_entry(const struct object_id *oid,
        }
 
        entry->no_try_delta = no_try_delta;
+
+       return entry;
 }
 
 static const char no_closure_warning[] = N_(