Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Blain <levraiphilippeblain@gmail.com>2023-01-16 20:41:48 +0300
committerJunio C Hamano <gitster@pobox.com>2023-01-19 02:13:21 +0300
commit97cf0c7de5dd49d9b518ebe694036159f6515422 (patch)
treea31e74bf1e2acadbf9b852d810a2174351da1a27 /branch.c
parenta7caae2729742fc80147bca1c02ae848cb55921a (diff)
branch: improve advice when --recurse-submodules fails
'git branch --recurse-submodules start from-here' fails if any submodule present in 'from-here' is not yet cloned (under submodule.propagateBranches=true). We then give this advice: "You may try updating the submodules using 'git checkout from-here && git submodule update --init'" If 'submodule.recurse' is set, 'git checkout from-here' will also fail since it will try to recursively checkout the submodules. Improve the advice by adding '--no-recurse-submodules' to the checkout command. Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com> Reviewed-by: Glen Choo <chooglen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'branch.c')
-rw-r--r--branch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/branch.c b/branch.c
index d182756827..e5614b53b3 100644
--- a/branch.c
+++ b/branch.c
@@ -756,7 +756,7 @@ void create_branches_recursively(struct repository *r, const char *name,
_("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'"),
+ advise(_("You may try updating the submodules using 'git checkout --no-recurse-submodules %s && git submodule update --init'"),
start_commitish);
exit(code);
}