]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/worktree.c
worktree: teach "add" to ignore submodule.recurse config
authorPhilippe Blain <levraiphilippeblain@gmail.com>
Sun, 27 Oct 2019 17:16:25 +0000 (17:16 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 30 Oct 2019 00:57:15 +0000 (09:57 +0900)
commit4782cf2ab686bacca8d2908319981ac27d54ca25
treef2ba37df193ff94f8fa3a44bf6f35eae508a07bd
parent5fa0f5238b0cd46cfe7f6fa76c3f526ea98148d9
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>
builtin/worktree.c
t/t2400-worktree-add.sh