aboutsummaryrefslogtreecommitdiffstats
path: root/branch.c
diff options
context:
space:
mode:
authorGlen Choo <chooglen@google.com>2022-03-29 20:01:17 +0000
committerJunio C Hamano <gitster@pobox.com>2022-03-30 13:40:00 -0700
commitcfbda6ba6b33e903df58f96fdb2ee9314097ff2f (patch)
tree4cf0027e42b5db9ef84f91c43984898002cc1ed3 /branch.c
parent75388bf5b47678c95f24b58007d2b37d744bf0f7 (diff)
downloadgit-cfbda6ba6b33e903df58f96fdb2ee9314097ff2f.tar.gz
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>
Diffstat (limited to 'branch.c')
-rw-r--r--branch.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/branch.c b/branch.c
index 608db0fc91..50459c432c 100644
--- a/branch.c
+++ b/branch.c
@@ -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(