@matheusbsbs / matheus-bagliano / commits / d00a5bdd50
Fork 0

submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb'

In 'submodule--helper.c', the structures and macros for callbacks belonging to any subcommand are named in the format: 'subcommand_cb' and 'SUBCOMMAND_CB_INIT' respectively. This was an exception for the subcommand 'foreach' of the command 'submodule'. Rename the aforementioned structures and macros: 'struct cb_foreach' to 'struct foreach_cb' and 'CB_FOREACH_INIT' to 'FOREACH_CB_INIT'. Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Shourya Shukla committed Mar 18, 2020 at 19:50 UTC d00a5bdd505540f2f3d8f1a3b99cd93425627e88
1 file changed +4 -4
builtin/submodule--helper.c
+4 -4
@@ -444,19 +444,19 @@ static void for_each_listed_submodule(const struct module_list *list,
444 fn(list->entries[i], cb_data);
445 }
446
447 -struct cb_foreach {
447 +struct foreach_cb {
448 int argc;
449 const char **argv;
450 const char *prefix;
451 int quiet;
452 int recursive;
453 };
454 -#define CB_FOREACH_INIT { 0 }
454 +#define FOREACH_CB_INIT { 0 }
455
456 static void runcommand_in_submodule_cb(const struct cache_entry *list_item,
457 void *cb_data)
458 {
459 - struct cb_foreach *info = cb_data;
459 + struct foreach_cb *info = cb_data;
460 const char *path = list_item->name;
461 const struct object_id *ce_oid = &list_item->oid;
462
@@ -557,7 +557,7 @@ cleanup:
557
558 static int module_foreach(int argc, const char **argv, const char *prefix)
559 {
560 - struct cb_foreach info = CB_FOREACH_INIT;
560 + struct foreach_cb info = FOREACH_CB_INIT;
561 struct pathspec pathspec;
562 struct module_list list = MODULE_LIST_INIT;
563