summaryrefslogtreecommitdiff
path: root/submodule.h
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-09-27 12:54:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-09-27 21:48:00 (GMT)
commitf69a6e4f076ec9ec89d94a6d960d0c161381a597 (patch)
treeeda087698e3048ba74f543049390e36823f806f1 /submodule.h
parent608cfd31cf8179ff971ddaf64675b47187e768c7 (diff)
downloadgit-f69a6e4f076ec9ec89d94a6d960d0c161381a597.zip
git-f69a6e4f076ec9ec89d94a6d960d0c161381a597.tar.gz
git-f69a6e4f076ec9ec89d94a6d960d0c161381a597.tar.bz2
*.h: move some *_INIT to designated initializers
Move various *_INIT macros to use designated initializers. This helps readability. I've only picked those leftover macros that were not touched by another in-flight series of mine which changed others, but also how initialization was done. In the case of SUBMODULE_ALTERNATE_SETUP_INIT I've left an explicit initialization of "error_mode", even though SUBMODULE_ALTERNATE_ERROR_IGNORE itself is defined as "0". Let's not peek under the hood and assume that enum fields we know the value of will stay at "0". The change to "TESTSUITE_INIT" in "t/helper/test-run-command.c" was part of an earlier on-list version[1] of c90be786da9 (test-tool run-command: fix flip-flop init pattern, 2021-09-11). 1. https://lore.kernel.org/git/patch-1.1-0aa4523ab6e-20210909T130849Z-avarab@gmail.com/ Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule.h')
-rw-r--r--submodule.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/submodule.h b/submodule.h
index 35d18c7..6bd2c99 100644
--- a/submodule.h
+++ b/submodule.h
@@ -37,7 +37,9 @@ struct submodule_update_strategy {
enum submodule_update_type type;
const char *command;
};
-#define SUBMODULE_UPDATE_STRATEGY_INIT {SM_UPDATE_UNSPECIFIED}
+#define SUBMODULE_UPDATE_STRATEGY_INIT { \
+ .type = SM_UPDATE_UNSPECIFIED, \
+}
int is_gitmodules_unmerged(struct index_state *istate);
int is_writing_gitmodules_ok(void);