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>
This commit is contained in:

committed by
Junio C Hamano

parent
5fa0f5238b
commit
4782cf2ab6
@ -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;
|
||||
|
Reference in New Issue
Block a user