1
0
mirror of https://github.com/git/git.git synced 2024-09-28 17:22:20 +02:00

branch: give submodule updating advice before exit

Fix a bug where "hint:" was printed _before_ "fatal:" (instead of the
other way around).

Signed-off-by: Glen Choo <chooglen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Glen Choo 2022-03-29 20:01:17 +00:00 committed by Junio C Hamano
parent 75388bf5b4
commit cfbda6ba6b

@ -602,11 +602,13 @@ void create_branches_recursively(struct repository *r, const char *name,
*/
for (i = 0; i < submodule_entry_list.entry_nr; i++) {
if (submodule_entry_list.entries[i].repo == NULL) {
int code = die_message(
_("submodule '%s': unable to find submodule"),
submodule_entry_list.entries[i].submodule->name);
if (advice_enabled(ADVICE_SUBMODULES_NOT_UPDATED))
advise(_("You may try updating the submodules using 'git checkout %s && git submodule update --init'"),
start_commitish);
die(_("submodule '%s': unable to find submodule"),
submodule_entry_list.entries[i].submodule->name);
exit(code);
}
if (submodule_create_branch(