From: Stefan Beller Date: Mon, 19 Dec 2016 20:57:24 GMT Subject: Re: [PATCH v2 10/11] worktree move: refuse to move worktrees with submodules Message-ID: In-Reply-To: <20161128094319.16176-11-pclouds@gmail.com> On Mon, Nov 28, 2016 at 1:43 AM, Nguyễn Thái Ngọc Duy wrote: > + > + if (S_ISGITLINK(ce->ce_mode)) { > + found_submodules = 1; > + break; > + } While I applaud being careful with submodules, I think this may be a bit overeager, because empty (both not initialized as well as not populated) submodules are fine. In origin/bw/grep-recurse-submodules^6 you find int is_submodule_populated(const char *path) that could be useful here, i.e. I'd imagine you'd change the condition to if (S_ISGITLINK(ce->ce_mode) && !is_submodule_populated(ce->name)) { ... I guess that can come as a fixup later though.