summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorPhilippe Blain <levraiphilippeblain@gmail.com>2019-10-27 17:16:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-10-30 00:57:15 (GMT)
commit4782cf2ab686bacca8d2908319981ac27d54ca25 (patch)
treef2ba37df193ff94f8fa3a44bf6f35eae508a07bd /builtin
parent5fa0f5238b0cd46cfe7f6fa76c3f526ea98148d9 (diff)
downloadgit-4782cf2ab686bacca8d2908319981ac27d54ca25.zip
git-4782cf2ab686bacca8d2908319981ac27d54ca25.tar.gz
git-4782cf2ab686bacca8d2908319981ac27d54ca25.tar.bz2
worktree: teach "add" to ignore submodule.recurse config
"worktree add" internally calls "reset --hard", but if submodule.recurse is set, reset tries to recurse into initialized submodules, which makes start_command try to cd into non-existing submodule paths and die. Fix that by making sure that the call to reset in "worktree add" does not recurse. Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/worktree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/worktree.c b/builtin/worktree.c
index a5bb02b..958bea9 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -377,7 +377,7 @@ static int add_worktree(const char *path, const char *refname,
if (opts->checkout) {
cp.argv = NULL;
argv_array_clear(&cp.args);
- argv_array_pushl(&cp.args, "reset", "--hard", NULL);
+ argv_array_pushl(&cp.args, "reset", "--hard", "--no-recurse-submodules", NULL);
if (opts->quiet)
argv_array_push(&cp.args, "--quiet");
cp.env = child_env.argv;