repack: make "exts" array available outside cmd_repack()

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>

Jeff King committed Nov 16, 2020 at 13:41 UTC 63f4d5cf571f4bec137d7e141bdd0f1d330371f4
1 file changed +10 -9
builtin/repack.c
+10 -9
@@ -202,6 +202,16 @@ static int write_oid(const struct object_id *oid, struct packed_git *pack,
202 return 0;
203 }
204
205 +static struct {
206 + const char *name;
207 + unsigned optional:1;
208 +} exts[] = {
209 + {".pack"},
210 + {".idx"},
211 + {".bitmap", 1},
212 + {".promisor", 1},
213 +};
214 +
215 static void repack_promisor_objects(const struct pack_objects_args *args,
216 struct string_list *names)
217 {
@@ -265,15 +275,6 @@ static void repack_promisor_objects(const struct pack_objects_args *args,
275
276 int cmd_repack(int argc, const char **argv, const char *prefix)
277 {
268 - struct {
269 - const char *name;
270 - unsigned optional:1;
271 - } exts[] = {
272 - {".pack"},
273 - {".idx"},
274 - {".bitmap", 1},
275 - {".promisor", 1},
276 - };
278 struct child_process cmd = CHILD_PROCESS_INIT;
279 struct string_list_item *item;
280 struct string_list names = STRING_LIST_INIT_DUP;