]> git.ipfire.org Git - thirdparty/git.git/commitdiff
repack: make "exts" array available outside cmd_repack()
authorJeff King <peff@peff.net>
Mon, 16 Nov 2020 18:41:12 +0000 (13:41 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 16 Nov 2020 23:57:43 +0000 (15:57 -0800)
We'll use it in a helper function soon.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/repack.c

index 01e7767c792866086ca889d7ea9d0310238c7c84..03e2c2c44b107cf3174df3d423cbdbca17ee0b7f 100644 (file)
@@ -202,6 +202,16 @@ static int write_oid(const struct object_id *oid, struct packed_git *pack,
        return 0;
 }
 
+static struct {
+       const char *name;
+       unsigned optional:1;
+} exts[] = {
+       {".pack"},
+       {".idx"},
+       {".bitmap", 1},
+       {".promisor", 1},
+};
+
 static void repack_promisor_objects(const struct pack_objects_args *args,
                                    struct string_list *names)
 {
@@ -265,15 +275,6 @@ static void repack_promisor_objects(const struct pack_objects_args *args,
 
 int cmd_repack(int argc, const char **argv, const char *prefix)
 {
-       struct {
-               const char *name;
-               unsigned optional:1;
-       } exts[] = {
-               {".pack"},
-               {".idx"},
-               {".bitmap", 1},
-               {".promisor", 1},
-       };
        struct child_process cmd = CHILD_PROCESS_INIT;
        struct string_list_item *item;
        struct string_list names = STRING_LIST_INIT_DUP;