Re: [PATCH v2 10/11] worktree move: refuse to move worktrees with submodules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 28, 2016 at 1:43 AM, Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> 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.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]