Re: [PATCH v2 10/11] worktree move: refuse to move worktrees with submodules
- From
Stefan Beller <sbeller@google.com>
- Date
- Dec 19, 2016, 20:57 UTC
- Message-ID
- <CAGZ79kbgJ=1j9V1QxmdzoKx60ZnqsJet2VwDH72Kz5PrDArOnA@mail.gmail.com>
- 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 <pclouds@gmail.com> wrote:
Show 5 quoted lines
> +
> + 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.