Skip to content

Commit cfbda6b

Browse files
chooglengitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 75388bf commit cfbda6b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

branch.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,11 +602,13 @@ void create_branches_recursively(struct repository *r, const char *name,
602602
*/
603603
for (i = 0; i < submodule_entry_list.entry_nr; i++) {
604604
if (submodule_entry_list.entries[i].repo == NULL) {
605+
int code = die_message(
606+
_("submodule '%s': unable to find submodule"),
607+
submodule_entry_list.entries[i].submodule->name);
605608
if (advice_enabled(ADVICE_SUBMODULES_NOT_UPDATED))
606609
advise(_("You may try updating the submodules using 'git checkout %s && git submodule update --init'"),
607610
start_commitish);
608-
die(_("submodule '%s': unable to find submodule"),
609-
submodule_entry_list.entries[i].submodule->name);
611+
exit(code);
610612
}
611613

612614
if (submodule_create_branch(

0 commit comments

Comments
 (0)